Lactase

Lactase is an enzyme which acts on lactose, breaking it down so it can be digested. 
Mammals in their infancy usually make lactase: they need it for digesting the lactose found in their mother's milk. Mammalian adults usually lose the capacity to produce lactase. Thus, if you give milk to an adult cat it causes discomfort and diarrhea.
Lactase evolution in humans.
Humans are somewhat different. Some humans continue to produce lactase, and some do not. It is a type of polymorphism.
The ability to digest lactose into adulthood ('lactase persistence') was useful to humans after the development of animal husbandry. This created a system providing a consistent supply of milk. 
Hunter-gatherer populations before the Neolithic revolution were overwhelmingly lactose intolerant. So are modern hunter-gatherers. 
Genetics.
A mutation on chromosome #2 stops the shutdown in lactase production, making it possible for those with the mutation to continue drinking fresh milk (and eating other dairy products) throughout their lives.
This appears to be a recent adaptation to dairy consumption. It has occurred independently in both northern Europe and East Africa in populations with a pastoral lifestyle. Lactase persistence, allowing lactose digestion to continue into adulthood, is a dominant allele, making lactose intolerance a recessive trait. 
Genetic studies suggest that the oldest mutations associated with lactase persistence only reached appreciable levels in human populations in the last ten thousand years. Therefore, lactase persistence is often cited as an example of recent human evolution. As lactase persistence is genetic, but animal husbandry a cultural trait, this is gene–culture coevolution.