From where does a classical comedy get its humor?

from the characters trying to escape their fate
from the characters' dialogue alone
from one or two characters who add comic relief
all of these