"Lactase persistence" allows some people to digest milk after infancy.
A mutation known as 13910T occurred some time in the last 5 to 10,000 years and is now widely present in Europeans and South Asians--largely in areas where Indo-European or Uralic languages are spoken. Another mutation, 22018A, which also confers lactase persistence, is often found together with 13910T but sometimes by itself.
According to Jean Manco, Ancestral Journeys, these mutations arose and spread in the late Neolithic period (5,000 or so years ago) among dairy farmers--dairy farming produces 5 times as many calories per acre as raising cattle for slaughter, so it was advantageous for people to possess these mutations and to be able to consume dairy products as adults.
There are other lactose-tolerant mutations, which are present in Mongols and the Kenyan Masaii, both herding groups which use milk and milk products.