Muscle itself is protein, but it takes more than protein to build it. To create new mass, your body needs energy and matter to create it. Guess what food is? A food’s caloric content is a measure of the energy in the food. At the end of the day, you must have eaten more calories than your body used to create new mass on your body. Your body cannot create new material out of thin air. You must also have ripped your muscle fibres, so that your body can repair them stronger and larger. While this sounds painful, it’s actually exactly what happens during strength training, and why you ‘feel the burn’.
The amount of food you eat determines the size out of your body.
How you train determines the composition.
This means that if you eat in caloric surplus, meaning you have extra calories at the end of the day, you will put on weight. If you do not have muscles to repair, or insuffient protein to repair them, it will be fat. If you trained hard, it will be muscle. That said, you can’t eat everything in sight then rip up some muscle to repair as a get out of jail free card. If there are leftovers, they will become fat.
It is more complicated than this, but simply, eating enough protein and calories in combination with strength training will build muscle. If you dieting, and thus eating a deficit, you can not gain muscle. There are simply not enough calories at the end of the day to build new muscle material, and in fact, your body loses material instead (which is the goal of a diet usually).
You might say, “I put on 2 lbs but I look skinnier, it must be muscle!” No. It takes about a month of solid caloric surplus and heavy training for a male to gain a pound of muscle. You did not gain 2 overnight. That is either retained water weight, undigested food, poop, or you are eating more than you think.
That said, it is possible to become stronger on a diet. Your central nervous system can adapt to lifting heavy weights, increasing your strength without significantly changing your muscles. Muscle fibres can also to a degree be repaired stronger but not larger if you eat protein. The only time you can gain muscle mass on a diet is if you:
a) are a COMPLETE beginner to strength training, and have never trained your muscles. this is known as “noob gains”, where your strength increases rapidly because your muscles are so unused to training.
b) use a diet approach that focuses on shifting caloric surpluses and deficits, often known as “recomp” or “intermittent fasting”.