Not all fruit beers explode, so let’s not start that rumor. But a few do, and the reason is sugar. Adding fruit to beer or wort increases its sugar level, and that means there is more food for the yeast to eat when the beer is fermenting.
Where this can go wrong is when a brewer believes a beer is finished fermenting, and ready to be bottled or canned, but, in reality, there is still residual sugar left in the liquid that came from the additional fruit. If that beer is prematurely packaged, the added sugar can be enough to wake the yeast up to keep eating. This (unintentional) second fermentation can create excess CO2 that can’t be absorbed by the liquid, so when that can is finally popped open, it will “explode,” looking like a more colorful version of Old Faithful.
The good news is, once the explosion stops, the beer is still absolutely fine to drink. The unfortunate part is that you’ll be left with less delicious fruit beer than you paid for, had the yeast not decided they were still hungry — and, considering the caliber of fruit beers that this happens with, you’ll likely be left with a bit of a mess on your hands.