Why did 40% of the human population evolve to tololactose

It is believed that a genetic mutation occurred in some ancestral human populations that allowed for the continued production of the enzyme lactase into adulthood, enabling individuals to digest lactose, the sugar found in milk. This mutation provided a survival advantage for those populations that relied on dairy products as a food source, particularly in regions where agriculture and animal domestication were common practices. Over time, this mutation spread through genetic intermixing and natural selection, resulting in the ability of around 40% of the global population to digest lactose into adulthood.