While laughter may have evolved from an ancient "fight or flight" response, it would seem that it has grown into a more complex recognition of another's "plight" response.
The dog in the "Cone of Shame" above encounters an upside down lampshade. We laugh because it looks like the lamp purposely rotated its shade to empathize with the poor dog.
Laughter in the face of tragedy doesn't always come from the "fight or flight" response, it can come from the more empathetic "plight" response. Laughter, in this case, is the body's naturally joyous response to another entity being acknowledged.
If we were to slip on the proverbial banana peel, we'd be instantly reassured on some level that it was recognized when someone else laughs. When they do, we instantly want them to say, "Oh sorry, are you okay?"