First of all, nature actually follows Darwin's theory of evolution: Survival of the fittest? This standard. I don't know if you have seen a set of pictures about giraffe evolution in junior high school biology textbooks. As time goes on, the tree becomes bigger and bigger. In order to get food in the tall trees, the giraffe's neck is getting longer and longer. The same is true of the developed muscles of gorillas. In order to get more food, gorillas will make corresponding adjustments according to the environment, so gradually with this muscle gene, gorillas will become muscle animals.
Secondly, the developed muscles of gorillas are also related to food intake. Although gorillas are mainly vegetarian, vegetarian food also contains some protein. Gorillas eat dozens of pounds a day, so they actually eat a lot of protein. We all know that protein is one of the most important substances for muscle development. If protein takes enough, it can accumulate energy for muscle formation, which makes it possible for gorillas' muscles to grow further in the later stage.
Finally, the developed muscles of gorillas are closely related to their daily exercise. Everyone should have seen gorillas on TV programs or in real life. Gorillas often jump up and down, and we often see gorillas swing from tree to tree at once. And during the day, gorillas are almost always exercising when they are awake. We humans exercise for about an hour every day, and over time we will form muscles, not to mention the amount of exercise that gorillas do. So I think the muscle development of gorillas is related to innate genes, plus eating enough food and exercising in the later period.