This habit is probably because we have always been a country with an agricultural society. We work at sunrise and rest at sunset. When the sun comes out, we work and go home when the sun goes down, so we have a meal before going out in the morning and go home for a second meal when the sun goes down.
There is another important reason. The peasants in ancient times were all exploited classes. Even if they work hard every day, even if there is a bumper harvest in autumn, a large part of these grains will be taken away by the ruling class. If the harvest is not good, they may make ends meet after handing in food, so in order to survive, they keep the habit of eating two meals a day.
As for the saying of two meals a day, in fact, ordinary people are forced by life to eat the third meal, but for the princes and nobles in the upper class, except for two meals a day at their own pace, three meals a day or even more meals a day are very relaxed for them. Even a simple breakfast, called Chaozhou style in ancient times, has dozens of kinds of porridge, staple food and side dishes. When eating dinner, there will be meat dishes and snacks besides the staple food, so even if you eat it twice a day, it is much better than ordinary people.
The emergence of two meals a day is due to backward productivity and lack of materials. Most people can't live the life of princes and nobles, which is caused by living conditions. With the continuous development of society and the continuous improvement of productivity, people's wealth is gradually increasing, and there are surplus assets to control. People take eating as the standard, so they gradually develop the habit of eating three meals a day.