All trials in life require faith and standing strong; if you can get past the worst trials in your life, you will cross over the finish line victorious and cheering. You did it, you passed the test!
I expect for the same reason that every other person of any other religion or without religion is able to be joyful. Human, ( not just Christians) are resilient. It is how we are made, it is our nature to adapt to the reality that faces us. The sc<x>ripture you quote is simply capturing this HUMAN reality. Nothing more or less.
This causes unnatural responses sometimes from Christians. I've seen people being "joyful" sfter their mother died.
BECAUSE THEY'RE SADOMASOCHISTS. YES I AM TYPING IN ALL CAPS!