Laughter releases endorphins, those brain chemicals that make you feel good. Hearing friendly laughter releases some, laughing yourself releases more. This is why there are laugh tracks on tv; if we hear laughter, we are more likely to laugh as well.
Normally, the endorphins are released, do their business, and then go away. However, sometimes there is reason for them to hang around a bit longer. Sustained periods of laughter can release the endorphins a little faster than they can go away, and so they start to pile up as the brain tries to restore equilibrium. The better we feel, the more apt we are to laugh, making us feel even better. Or, we are tired, and the brain was already starting to shut down for the night and so isn’t ready to help clear out the flood of endorphins that have suddenly showed up.
Eventually, the brain kicks itself into overdrive to clear out all the backlogged endorphins, and the giggle fit ends. This often leaves us feeling quite worn out afterwards, but still feels good.