Sometimes these things happen. Sometimes good things happen. Sometimes bad things happen.
But things just happen. These are meant to be reassuring words to comfort someone when something (good or bad) happens and you are not sure what to say…
I have heard these words a lot the past few days when both good and bad things have happened.