Why do potatoes foam when frying?

Online Answer
Foaming is caused by oil degradation or contamination, which is often the result of frying with oil on too high a temperature, overusing the oil or frying with poor quality oil that contains impurities. Oil foaming can be caused by any of these factors and is often a combination of more than one issue.
Related Questions 📌
Frothy Oil If your oil is bubbly or foamy but not discoloured then you may have overfilled the sump. The oil is essentially being churned and aerated by the crank and can cause a lot of damage very quickly. If the foam is lighter in colour this could be down to water or coolant contamination.
When the air pocket is heated gradually, it expands slowly enough that the air can escape through the microscopic holes in the shell (look closely: you'll see a trail of tiny bubbles coming from the base). Another problem people have with hard-boiled eggs is peeling them.
To prevent a peeled potato from falling apart during cooking, soak in cold salt water for 10-15 minutes prior to cooking. Add a little lemon juice or a teaspoon of vinegar to the water when boiling potatoes to prevent them from discoloring..