Because your hormones tell you to.
It is obvious that in order to grow, a body needs to accumulate the material out of which it is made. But adults who have stopped growing (at least vertically) still lose mass every day, and must replace it.
But we also eat in order to get energy. We eat fats and carbohydrates mostly for the energy they provide. We can also burn proteins, but we mostly eat proteins to get the raw materials for making the proteins our body is made from, and that we use as catalysts (enzymes) to guide chemical reactions.
But the urge to eat, that need we feel when we are hungry, is due to hormones.
The hormone ghrelin is produced in the brain, but also in the pancreas and the lining of the stomach. It is produced at high levels before meals, and decreases after meals. It makes you feel hungry.
Other molecules that make you feel hungry are neuropeptide Y, which is secreted by your intestines, and anandamide, which binds to the same receptors in the brain as marijuana , which explains why marijuana users feel hungry afterwards.
Another hormone, leptin, is produced in fat cells. It makes you feel full, no longer hungry. It affects your appetite, but also how fast you burn energy. It acts by inhibiting the effects of neuropeptide Y and anandamide, and increasing levels of α-MSH (alpha MSH), which is another appetite suppressant.
Other hormones and signaling molecules are involved in regulating appetite and metabolism, including insulin, and each of the hormones and signals are used in different places in the body to do different things. The science of how we regulate our metabolism is very complex and interrelated with other bodily function in complicated ways.