When the batter is cooked it expands in the pan lowering the density of the cake batter. So one bite of the cake has less sugar than a similar sized bite of cake batter.
As a heads up the reasons why packaging says not to eat raw batter is that raw eggs can contain salmonella and raw flour can have e coli, either of which lead to mild to severe food poisoning.
Latest Answers