Each food product contains proteins, fats and carbs in different ratios, and each component is digested by specific enzymes in different sections of a gastrointestinal tract. Everything begins in the mouth, where during chewing together with saliva a bit of amylase is secreted. It breaks down complex carbs into simpler ones. It lasts all the time the food is in the mouth (15−20 seconds), next through a food pipe it gets into the stomach, where it's awaited by the extremely aggressive gastric juice, which consists of:
— hydrochloric acid, which participates in protein denaturation and creates the optimal acidity for enzymes, which are secreted by chief cells in an inactive state. Hydrochloric acid turns (activates) pepsinogens (these enzymes) into pepsins, has antiseptic effect, regulates evacuation of chyme (that's what food turned into) to the duodenum, and stimulates secretion of enterokinase and intestinal hormones in the duodenum.
— pepsin, enzyme that breaks down complex proteins into peptides and then into amino acids,
— stomach lipase, which catalyzes the hydrolysis of fats,
— mucin, which has a protective function,
— intrinsic factor, which helps vitamin B12 get absorbed.
Wait a minute. In school we all were told that hydrochloric acid is a dangerous substance, which can lead to chemical burns. Then why doesn't the stomach digest itself? In fact, it does (otherwise there wouldn't have been a gastric ulcer), but it happens if you don't use your digestive system correctly. For example, if you starve yourself (periodically teasing yourself with appetizing flavors and thereby stimulating the production of gastric juice) or consume food with a chemically or thermally aggressive composition. However, if you treat yourself responsibly, the stomach has protection against hydrochloric acid: it's mucus, mucin, and bicarbonates. The bicarbonates react with hydrochloric acid, resulting in carbon dioxide, water and chlorine (which will get back into the cell, where hydrochloric acid will be formed again).
The most important digestion takes place farther, in duodenum, which secretes bile, pancreatic amylase (breaks down carbohydrates), trypsin (breaks down uncracked proteins), lipase, which hydrolyzes fats and bicarbonates (neutralize the acid stomach juice, as we said above).
Let's assume that everything has been digested at different stages, decomposed into monomers, glucoses, simpler proteins, amino acids, water, electrolytes, and so on, and we finally get to the main point — absorption of all these substances. Our gastrointestinal tract is lined with epithelium over its entire surface, the cells adhere to each other tightly, but still there are small spaces between them, through which some water, electrolytes (like sodium and chlorine from salt) are absorbed. Here we don't spend much energy, the transport occurs passively, according to the concentration gradient: the substance from the place where there's more of it gets to the place where there's less of it. There's also active transport (Na-K-pump), which transports against the concentration gradient across the cell membrane. In a nutshell, everything that's useful is transported in the form of amino acids, glucose and fructose, electrolytes, cholesterol, phospholipids, and so on into our cells. Water and ions are absorbed in the colon.
What will happen further? If we take carbos as the nutrients from which energy is most quickly obtained, then the following will happen with glucose: first, it'll enter the cell through channels. Then glycolysis, a process that produces two molecules of pyruvic acid and two molecules of ATP, will start. But that's not all. The pyruvic acid goes further into the mitochondrion, and from there into the citrate cycle or Krebs cycle. This is a sequential, looped process, resulting in pyruvic acid, which turns into fumarate, and 2 ATP molecules with the same high-energy bonds.
The final stage of energy exchange takes place in the intermembrane space of mitochondria, where 32 ATP molecules are formed during oxidative phosphorylation. (The process is complex, consisting in the transfer of electrons using special transporters and the creation of an electrochemical gradient due to proton accumulation).