While Egypt and Mesopotamia likely produced some early organized comedic plays or stories, the best known tend to be those from ancient Greece. The Greeks formalized their plays into satire, tragedy, and comedy. Similar to Mesopotamia and Egypt, sex and political satire are the subjects for early Greek comedy by Aristophanes, who perhaps is one of the earliest known authors of comedy known to us, who lived around 400 BC and lived in Athens. He was also very active in writing comedy, writing perhaps more than 40 comedies, of which 11 have survived. Aristotle philosophized that Greek comedy originated from what normally would have been solemn or otherwise crass or obscure religious festivals such as phallic processing, which led people to make fun of such acts or satirize them at least. Aristotle also helped formalize comedy as legitimate literature and he defined it as a positive benefit to society. In fact, he stated comedy did not have to be crass but good-natured comedy could be positive to society and bring general happiness to the wider public and provide a public good.
Greek theater had begun to develop in the early first millennium BCE, whereby the Roman period it had become the foundation in which Roman society developed their own understanding of entertainment. Titus Maccius Plautus and Publius Terentius Afer are some of the best known Roman comedic writers, who lived in the 3rd-2nd century BC. Most of the content was influenced by Greek subjects but development by these authors and the Romans begin to look more modern to us and, in fact, influenced what we would call modern comedies enacted today in theatre and even television. For one, a key development was telling the story over a series of episodes within the larger story. Music also accompanied the wider acting out of the comedy. In the stories, generally, the character would undergo some trial or tribulation before some comedic way in which the problem could be resolved. Their works also developed key characters in a comedy. This includes a villain, a hero, dual characters who are neither heroic nor villains, the love interest, and others (e.g., slave dealers) that would be satirized or even presented in a stereotype that Roman audiences would quickly identify.