How does heat make a marshmallow brown?

Maillard Reaction

As the marshmallow is exposed to heat, the high temperature causes the breakdown of the sugar and protein molecules, resulting in the formation of complex new compounds known as melanoidins. These melanoidins are responsible for the characteristic brown color of the marshmallow.

In addition to the browning effect, the Maillard reaction also creates the desirable flavors and aromas associated with toasted marshmallows, such as the nutty, caramel-like notes that enhance its overall taste.