There was a theory that mourning at a funeral is actually mourning for oneself as at some point you will be in the same situation as the deceased and it reminds you of your own mortality.
I suspect that is a healthy way of looking at it all.