In evolutionary terms, primates "Laugh" to release tension after the evaporation of a percieved threat. This is why the smile is very close to a bare-teethed threat signal. Humans also use laughter to defuse threats. The anthropology of the trickster figure (Loki, for example) is long and complex, but is often used to avoid conflict. Laughter seems to be part of the glue that sticks humans together into non family groupings.