The majority of Indo-Aryan languages derive from Sanskrit, the language of ancient India. The earliest form of Sanskrit recorded is Vedic Sanskrit: the language used in the oldest scriptures of India, notably the Rigveda. Its character is demonstrably old, with many links to the Indo-European parent language.
In the fifth century BC, Sanskrit had evolved somewhat, and the grammarian Panini codified and standardized it; this led (in about 200 BC) to what is now known as 'Classical' Sanskrit. However, although this preserved the integrity of written language for a long time, the spoken language continues to evolve, and by the sixth century AD, Sanskrit as a spoken language was rare, being by and large replaced by its descendants, the Prakrits. All the Prakrits share a common ancestry, but they are not necessarily mutually intelligible.
Apabhransha was the next modification in the spoken language, in a period broadly lasting from the fifth to the tenth century AD. Increasing numbers of literary texts begin to appear in Apabhransha languages, and the Sravakachar of Devasena (dated to the 930s AD) is now considered to be the first Hindi book.
The next major change occurred with the Muslim invasions of India in the 13-16th centuries AD. Under the Mughal empire flourishing, Persian was adopted as the language of Indian government. However, many people felt this to be artificial, and soon Persian, with all its Arabic influences was absorbed into the indigenous Indo-Aryan language, the late Apabhransha or early stabilizing Hindi.
In the Hindi-speaking areas, the main form was Braj-bhasha, which is still spoken today, but was replaced in the 19th Century by the Khari Boli dialect. However, a large proportion of Late Apabhransha and Hindi vocabulary is derived from Perso-Arabic. Urdu is the name given to the language that ultimately comes out of the Mughal period.
This state of affairs continued until the Partition of India in 1947. Urdu was replaced by 'Hindi' as the official language of India, and soon Perso-Arabic words began to be excised from the Hindi corpus, in a bid to make the language more 'Indian'. They were replaced by Sanskrit words, sometimes borrowed wholesale, or in new compounds. As of 2002, there is a continuum of Urdu-Hindi, with heavily-Persianized Urdu at one end, and Sanskritized Hindi at the other, although the basic grammar remains identical. The language used by most speakers of the language lies in the middle.