Why does heat solidify cake batter?
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.