Why it happens
When you cream butter and sugar and then add eggs, you're making an emulsion of fat and water. If the eggs are cold or added too quickly, the butter firms up and can't hold the liquid, so the mixture separates. This is called curdling. Flour absorbs the excess liquid and helps bind it back together. A curdled batter can give a slightly denser cake, but it is rarely a disaster.