Increased vibration causes the atoms in an object to spread out farther away. Thus, with added heat, and object goes form a solid to a liquid to a gas (and then to plasma, with enough heat). Why is it then, that when a heat something like cake batter, it solidifies?
It is caused by physical and chemical reactions in the cake batter of two types:
1) When heated and mixed with water, starches present in the flour will undergo a process called gelatinization in which water is absorbed in the structure. This will cause the batter to 'set' from a liquid into a solid.
2) Additionally, reactions of the proteins from the egg that you added can also work to 'set' the batter. At first the proteins will unfold (denature) after which they start to form bigger proteins through cross-linking reactions that turn the liquid into a solid.
The baking soda in the batter turns into sodium carbonate, water and carbon dioxide. The latter will make your cake nice and fluffy.