Western scholars have typically divided up the history of Hinduism into periods that roughly match the periods used to understand history in the West: ancient, medieval, modern, etc. There are many problems with this, not the least of which is that Hinduism has not developed in a linear manner. Later developments overlap, rather than replace, what came before; there are, therefore, no neat or clear historical breaks.
The earliest stratum of what can properly be called "Hinduism," of which the Vedas are the core, developed from about 1500 B.C.E. until about 500 B.C.E. Something new emerged at this point, a new religious worldview based not on the power of ritual sacrifice, but on the ideal of asceticism; it is important to note, however, that the Vedic tradition was not replaced, but rather, eventually, came to be understood as underlying (and thus supporting) these later developments. Buddhism and Jainism emerged out of this new religious climate, initially as internal reforms, but eventually as separate religions.
Buddhism in particular posed a challenge to Hinduism, not only in terms of its opposing religious ideals, but also because Buddhism opened new avenues for religious participation to people who, under the earlier system, were largely excluded. Because the Buddha and his followers rejected the ideas of caste distinctions that were central to the Vedic worldview, it attracted supporters from the merchant classes, particularly in the rapidly emerging cities in northern India along the Silk Route. Kings and lesser local rulers, especially, began to give their support to Buddhism, since their lower caste statusin relation to the Brahminsdid not imply a lesser religious status. The result of this, from about the 3rd century B.C.E. until about the 10th century C.E., was the relative ascendency of Buddhism at the expense of Hinduism.
This began to change, however, with the rise of sectarianism within Hinduism. The rise of Vaishnava Hinduism is particularly crucial here. Although Vishnu had long been a central god in Hinduism, by the latter part of the first millennium C.E., Vishnu's character had become particularly associated with kingly virtue. Various forms of Vishnu, particularly Rama, were depicted as the ideal ruler, the restorer and upholder of dharma. Kings began to shift their allegiance away from Buddhism to Vaishnava Hinduism (as well as Shaiva Hinduism), which had gradual but quite dramatic effects: by about 1200 C.E., Buddhism had all but died out in its homeland.
By the beginning of the second millennium C.E., the Hindu pantheon had begun to dramatically expand, and thousands and thousands of local versions of the gods began to emerge. Multiple forms of Vishnu emerged, as did various "incarnations" of Shiva, as well as numerous forms of Devi, the goddess. Scholars often refer to this as the rise of "sectarian" Hinduism. One important aspect of this rising sectarian devotion was the construction of great temples to various gods and goddesses throughout India. Many of these temples were sponsored by kings and had particular royal associations.