While marshmallows have some vanilla flavor, the action of toasting them sets off a complex chemical reaction that fundamentally changes the flavor, making it taste more caramelly. It’s basically the difference between a raw marshmallow and a roasted one!