The early invention of cheese led to adult human tolerance of lactose. Before the invention of cheese approximately 8,500 years ago, adult human digestive systems were uniformly intolerant of lactose.
The development of perfect, delicious cheese began with an environmental disaster, when early farmers over-planted their fields rendering them fallow. This forced humans to herd goats and sheep more, since they could live off of lands that were unfit to practice agriculture. This coincided with the invention of pottery, which, for our purposes, can be thought of as milk collectors. Human babies and children were built to tolerate milk, but they lost that ability as they reached adulthood. The first cheese was likely invented when a person in the warm Fertile Crescent (Middle Eastern) region collected milk and did not use it right away. In the heat, the milk would have coagulated within a few hours into cheese. Some courageous adult would have then eaten the solid material created in that bowl and found that new substance to be much more digestible than the milk that it came from. That substance was the first cheese made by a human.
When cheese is made, 80% of the lactose from milk drains away so it is more stomach-able. As cheesemaking spread so did dairying, and people were able to add a new source of nutrients to their diets. As children became exposed to milk more often, genetic mutations developed that were more tolerant to the lower doses of lactose in cheese. Those children became adults who were more tolerant of lactose than their parents. That tolerant genetic mutation spread through humanity over the next few thousand years and developed the capacity in humans to tolerate lactose. This eventually lead to the creation of pizza as we know it, for which we are all thankful.