Lactose intolerance is more common than the ability to digest milk in adults around the world. For all humans, the ability to digest breast milk as infants is essential to survival. However, after weaning from the breast, this ability is no longer needed and the gene that produces the enzyme in the intestines for digesting milk, called lactase, is turned off. This was true until about 5,000 years ago, when humans now enjoying the benefits of growing grain for thousands of years, began to drink the milk from goats, cows, and other mammals after they delivered their offspring. To do this, dairy farmers kept their cows pregnant and stimulated more milk production by pulling on the breasts of the animals each morning.
Since ancient mankind had a diet dominated by plant foods, most of the protein they ate was from plants and they ate lots of plants to get both the calories and protein they needed. They ate about two to three times the amount most humans eat today from plants with the occasional fish or meat meal. Milk being a good source of calories and protein gave an advantage to children who drank milk over those who subsisted on grains. In fact, when the Romans invaded what is now Northern Europe, they found that the Germanic tribesmen were much taller than the Roman soldiers and had more muscle. This ability to drink milk provided an advantage and was due to a mutation of gene regulating the activity of the gene coding for the lactase enzyme that stopped it from turning off after weaning from the breast.
In those who can digest milk, the enzyme persists for life. However, humans don’t need milk after weaning as high quality protein can be obtained from a diverse diet including animal proteins and soy protein, the highest quality protein in the plant world. Individuals with lactose intolerance can purchase dairy products pre-treated with lactase.
The point of the discussion is that your genes are not fixed for life. They respond to nutrients in the diet such as milk sugar during breastfeeding and then turn off or stay on. With aging some lactase is typically lost in the intestine explaining why some people develop lactose intolerance later in life.