I think there are several lessons in Buddhist doctrine -- and that two of them are:
Things happen for reasons, and what happens isn't necessarily "unjust"
Things happen (or stop happening) whether you like it or not, sometimes for reason which are outside your control -- you might try to anticipate that (e.g. knowing that things are impermanent), and to develop an appropriate attitude and reaction to events like that when they do occur.