Mammals lose the ability to digest lactose after infancy. The body stops producing the enzyme, lactase, that digests lactose. I don’t know whether it’s because it gives an evolutionary advantage, or if there is simply no evolutionary disadvantage.
So lactose-intolerance in adulthood is actually the human default, too. And somehow researchers have managed to demonstrate that the northern European ability to digest lactose in adulthood and the Maasai ability to do the same are the results of two separate mutations. In either case, given the circumstances of both peoples, there is an advantage to being able to continue eating dairy in adulthood. But whether the mutation occurred first and allowed people to eat the food, or whether people were trying to eat the food and some developed the mutation and thrived better, is an open question.