The most likely explanation is **sugar triggering bubble formation, followed by the coffee stabilizing those bubbles into foam**.

Sugar crystals have tiny crevices and trapped air pockets that provide *nucleation sites*—places where bubbles can start growing. Heating reduces how much dissolved gas the liquid can hold, so adding sugar can help that gas escape as many small bubbles. If the coffee is near or above its boiling point, sugar can also trigger a brief burst of steam bubbles. [Physicist Lou Bloomfield explains both mechanisms here.](https://howeverythingworks.org/1997/06/18/question-1183/)

Microwave heating can make this more noticeable because it heats the liquid directly, without the hot vessel surface that normally encourages bubbles to form during stovetop heating. A smooth glass can therefore leave bubble formation delayed until you add the sugar. The precise difference in your case depends on the temperatures and how much stirring or pouring each method involves. [UNSW’s explanation of microwave heating and nucleation](https://www.animations.physics.unsw.edu.au/jw/superheating.htm)

**The bubbles persist because coffee contains natural foam-stabilizing compounds**, including protein-related substances, melanoidins and polysaccharides. These help keep bubble walls from breaking immediately. Their longevity suggests that the remaining bubbles contain air or other noncondensing gases: pure steam bubbles would disappear as the coffee cooled. [Research on coffee’s foaming compounds](https://pubmed.ncbi.nlm.nih.gov/15537326/)

So the observation does not, by itself, prove superheating. Tiny persistent foam is consistent with gas release; sudden vigorous boiling when sugar is added would point more strongly to superheating.