Nowhere is the bewildering diversity of the people of India more apparent than on the Rupee: the value of each banknote is spelt out in 17 languages.

Tracing the origins of this type of diversity has only recently been opened up past the historical. Nowadays, genome analysis has emerged to complement history in understanding our origins: by looking at the individual differences in the genetic code in individuals, we can identify how closely populations and families are related, and infer the migration and mating that brought us into the modern age. Strangely, genetic analysis of the billion strong population of the subcontinent has been slow to kick off. But a new study has revealed that despite the population of India being incredibly diverse, it is in fact derived from just two distinct ancient populations. One of these, from the north, were distant cousins of Europeans and Middle Easterners, whereas those from the south were as different from the northerners as they were from the Chinese.

These distinctions are not visible now, but this ancestry is buried deep in the Indian genome. Almost all sampled showed a blend of these two ancestral groups, but in differing proportions. When David Reich and colleagues sampled people – accounting for geography, language and caste – they found the range of genetic diversity in India is up to four times greater than that found in Europeans: Indians of different groups are less similar than a Scot and a German. I have Indian heritage but no cultural input: I'm as English as cricket. But upon arriving in Mumbai, I had the strange sense that there were many more people there that look a bit more like me than at home. It made me think of the horrific old racist maxim, "they all look the same to me." Of course, this is just plain stupid, but genetically, it couldn't be further from the truth. So, how do you get from two distinct populations to the broad range of genetic diversity?

In a population where there's a range of hair colour, for example, ginger genes might eventually blend in and be lost through breeding with non-redheads. But if a ginger family became isolated (literally or for social reasons) from the rest of the population and could therefore only breed within, then that whole population would be predominantly ginger. In evolutionary terms we call this a "founder event". And it appears that India's genetic spread is a result of many founder events at times during the last 3000 years: small pockets of populations that were endogamous: that is, they didn't breed much beyond their group. I don't expect many of them were ginger though.

There are a number of interesting implications for this. The first is that the consequence of endogamy revealed by this genetic map of a billion people is that we should expect to see a higher frequency of recessive genetic diseases, in the same way that we observe in Ashkenazi Jews or the Finns. Indian scientists are aware of disorders within their populations that rely on a unique genetic heritage, and have attributed it to marriage to close relatives, which is relatively common in the south. But the roots of these diseases may be deeper than cousins marrying.

There's a second socio-political inference. The caste system has existed in India for centuries, and although great efforts have been made to reduce its divisive nature (caste-based discrimination is outlawed under the constitution), it remains active and controversial. It has been suggested that caste was to some degree an invention of (or at least galvanised by) the British during colonialism. What the genetics now says is that this endogamy within castes has kept social groups relatively separate for thousands of years, and hence defined India's population in genetic terms. Reich commented that "There are populations that have lived in the same town and same village for thousands of years without exchanging genes." On top of this, this and other studies have shown a higher proportion of high caste members share genetic traits with those from the northern ancestral group. This may yet prove to be controversial if it can be spun to defend a rigid caste structure.

It's quite clear that India is now emerging as a potential superpower. Yesterday, a long time after the west stopped going there, the first Indian lunar mission claims to have found water on the moon. As India's saga continues, scientists have uncovered the deep roots of a billion individual's social structure by looking in their genes.