Comedy showed up in the late fourteenth century from the Old French comedie—meaning poem—and the classical Latin comoedia. Now, that lineage isn’t unique among the etymologies of English words, but there’s more to it this time. Latin took their word from the Greek komoidia, comedy or farce. It’s related to komodios, an actor or singer, komos, revel or festival, and aoidos, minstrel or vocalist (and also related to ode). This means that the Greek and Latin versions of comedy were similar in meaning to what we now use comedy for. It was Middle English that twisted everything up, giving it the meaning of an epic poem like Dante’s Divine Comedy. It wasn’t until 1871 that English “restored” it to its original meaning.
Drama showed up in the early sixteenth century from the Late Latin drama, a play or drama, and the Greek…drama again. They did not get creative with this one. Like in Latin, the Greek drama meant play like we would think, but also action or deed, likely because it comes from another word, dran, which meant do a significant deed. Dran can also be traced all the way back to the Proto Indo European dere, to work.
TL;DR: Comedy was funny, then it wasn’t, then it was again. Drama, however, is just plain work.