How the heck does this happen? When citric acid and baking soda come together, they release carbon dioxide (CO2) - the fizz in the bath bombs. If the CO2 has nowhere to go, it will put pressure on the container and it could force the top off the container violently. So what does this teach us? Do not put your bath bombs in a sealed container - plastic, glass or otherwise! Put them into a nice cellophane bag or a sushi container (in the case of cupcakes) or other bag-like storage!
As a secondary note, the article mentions the citric acid could irritate eyes. If you put the citric acid in your eyes, then yes, it will sting. An easy way to avoid this? Don't put the citric acid in your eyes. (If you are the unfortunate victim of this exploding container, then I guess it's unavoidable. For the rest of you, remember what I say in craft group - if you eat it and you get sick, it's not my fault. I'll be sad you're sick, but I warn everyone to not put things in their eyes, ears, nose, and mouth!)