In early cultures, the nearest thing to proto-drama is found as ritualistic religious celebration in the form of song and dance. The same process happens in the Middle Ages when the Church recoils from too much elaborate drama and moves such goings-on outside the churches. Catholic Mass on Palm Sunday still retains some semi-dramatic hullabaloo in which we the people get the lines, "Crucify him. Crucify him." Or, drama is like Halloween costume parties: something that once had esoteric religious significance and now is manifested as a public spectacle.
In the late 6th century bce, Athenians celebrated as a city and a people at an annual festival that had been originally a rural celebration of Dionysus as a vegetation deity. The festivities included dancing choruses competing for prizes and hymns singing the praises of the gods. An innovator, possibly named Thespis (from which we derive Thespians), combined choral song with the speeches of masked actors playing heroes or gods. Characters would have dialogues with the chorus.
Writing made possible the memorization of choral song by groups for public presentation. The chorus would speak in frst person for itself, but did not equal the voice of the poet. Pindar (518-438 bce) was the greatest choral poet, often writing victory odes to athletes.
In the 5th century bce, the Greeks defeated the Persian invaders (480-479 bce), which strengthened feelings of confidence in Athenian democracy. The arts flourished. Drama was still a new form, but it took shape into comedy and tragedy in Athens. "Tragoidia" = goat song. The goat was an animal associated with Dionysus, at whose spring festival in Athens tragedies were staged, so possibly the name was taken from a song sung during sacrifice originally. (Dionysus is a called upon in Oedipus Rex.) Tragedies were like modern screenplays or prompt books. The actors were always male, and probably so too was the entire audience. A play would include no more than three characters in number, wearing masks for stereotypical identification of features (old man, young girl, king).
The "Dionysia" was a four-day celebration in Athens during which public business was suspended. Prisoners were even released on bail for this. Three poets in tragedy and three in comedy would be chosen to compete. The sequence of days and rules of competition allowed for trilogies to develop.