In the second millennium BCE, people speaking an early form of Sanskrit, an Indo-European language related to Persian, Greek and Latin, spread into the north-west of the subcontinent. How and when they came, and how they mixed with the people already there, is still debated. They called themselves Arya, “noble”, herded cattle and horses, and drove light chariots.
Their priests composed the hymns of the Rigveda, probably between about 1500 and 1000 BCE, praising gods such as Indra, Agni and Varuna. The hymns were memorised with great precision and passed down by word of mouth for many centuries before they were written down. Three more Vedas followed, and later texts, the Brahmanas and the Upanishads.
Over the following centuries the centre of Vedic culture moved east to the Ganges plain, where forests were cleared with iron tools and rice was farmed. Tribes became kingdoms, and by the 6th century BCE there were sixteen great states, the mahajanapadas, among them Kosala and Magadha, with towns once again.
Society came to be described in terms of four varnas: priests, the Brahmins; warriors and rulers, the Kshatriyas; farmers and traders, the Vaishyas; and labourers, the Shudras. In practice people belonged to many smaller hereditary groups, the jatis, and the system grew more rigid over time. The Upanishads, composed from about the 8th to the 5th century BCE, explored ideas of the self, rebirth and release from it.