Eggs foam because it contains moisture like most other foods you fry. The oil gets foamy when moisture is trapped on the surface of the oil. Tip: Before frying, Your eggs get foamy because the white or albumen part has caught some air while you beating it.