Water (or stuff that's water with a little bit of very well dissolved stuff in it, like coffee) can become superheated past 100C without boiling if there aren't any nucleation sites for bubbles to form. No bubbles, no boiling. Add nucleation sites (e.g. granules of sugar in your case) and it immediately boils so violently that the boiling liquid can erupt out of the vessel. It's not an actual explosion, but it can throw superheated water up several inches and steam up further, i.e. enough to badly burn you. Even just moving the vessel can be enough to introduce nucleation sites and set off the eruptive boiling.
Don't microwave liquids in very smooth containers (i.e. too smooth to have nucleation sites) unless you're sure the liquid contains nucleation sites within it (e.g. stuff like soup with chunks of meat or veg in it). It's much more likely with very pure water, but it can happen with water containing some kinds of impurities, including well dissolved coffee. It's very unlikely, but it can happen.
Easy solution - make sure there are nucleation sites by putting a wooden stirrer or something in the cup before microwaving it.