Why were cornflakes invented?

Cornflakes were invented in the late 19th century by John Harvey Kellogg and his brother Will Keith Kellogg. They were originally created as a health food to promote digestive health and to provide a nutritious breakfast option.
John Harvey Kellogg was a physician who believed that a diet of bland and simple foods would aid digestion and reduce the urge to masturbate, which he believed was a leading cause of various diseases. He experimented with different grains and preparation methods, and eventually developed a process for cooking and flattening cornmeal that resulted in the creation of cornflakes.
Initially, the Kellogg brothers produced cornflakes as part of their health spa business in Michigan, but the popularity of the cereal soon led them to establish the Kellogg Company in 1906, which became one of the largest food companies in the world. Today, cornflakes are enjoyed by millions of people as a popular breakfast cereal.