The title is rather trivial, but many people, even "pseudo-experts," still don't understand the fundamental rules of our metabolism, thereby harming themselves with a specific diet or, for example, silly workouts.
So, we've all heard that eating a lot of high-calorie foods can lead to weight gain. Let's first clarify what the caloric value of food is. This is the amount of energy our body receives during the biochemical processing of this food. To understand caloric value, even non-physicists need only imagine two substances of the same mass/volume burning, for example, alcohol and diesel fuel. Which one produces more heat? Anyone who has ever seen such a combustion will immediately answer: diesel fuel. This means its caloric value is higher (~10,300 kcal/l, compared to ethyl alcohol's ~7,000 kcal/l). It's the same with food: some foods produce a lot of heat/energy, others less. We figured it out.
Now imagine a person who constantly eats high-calorie foods. Will they gain weight? Fitness trainers unanimously answer this question: "Yes, under these conditions, you will always gain weight."
I'll tell you—it's not a given. A person will only gain weight based on the amount of food they consume. Whether their fat, muscle, and other tissues will increase depends heavily on their individual metabolic processes. You probably all know someone who eats everything and doesn't gain weight. Now I'll tell you why.
The fact is that the "fuel" that enters the body in the form of food is "processed" to produce energy differently in each person. Moreover, there can be both safe genetic configurations and pathological ones. Here are the most common pathological cases: A person has low stomach acidity, as a result, protein breakdown reactions are slowed (these reactions require an acidic environment with a certain pH). These people usually have a poor appetite and an aversion to meat. Some individuals, influenced by internet idiots, begin to think this is a sign to become a vegan.
A person's gastrointestinal tract is not functioning properly, for example, the number of enzymes/bacteria needed to break down proteins into peptides, fats into fatty acids, and carbohydrates into glucose is reduced.
A person has problems with anabolic hormones. For example, loss of growth hormone secretion, low insulin levels, low androgen or estrogen levels.
In all these scenarios, no matter how much high-calorie food you eat, you won't gain weight! Because the food won't undergo all the necessary biochemical processing steps to produce energy.
Moreover, if you add physical activity (like going to the gym with a trainer who's completed a training course :)), you'll do even more harm to your body! Your body will experience a severe deficit in the energy you expended through exercise but can't fully replenish through food.
Therefore, if you've been struggling to gain weight for years, specifically muscle weight (as gaining fat is not beneficial ), first have your body examined for the issues described above by qualified specialists, or figure it out yourself. Only after addressing these issues should you begin to challenge your body with food and exercise.