Upvote:1
From Wikipedia:
The Baphuon (Khmer: ប្រាសាទបាពួន) is a temple at Angkor, Cambodia. It is located in Angkor Thom, northwest of the Bayon. Built in the mid-11th century, it is a three-tiered temple mountain built as the state temple of Udayadityavarman II dedicated to the Hindu God Shiva. It is the archetype of the Baphuon style with intricate carvings covering every available surface.
In the late 15th century, the Baphuon was converted to a Buddhist temple. A 9-meter tall by 70 meter long statue of a reclining Buddha was built on the west side's second level, which probably required the demolition of the 8-meter tower above to supply stones for the statue, thus explaining its current absence. The temple was built on land filled with sand, and due to its immense size the site was unstable throughout its history. Large portions had probably already collapsed by the time the Buddha was added.
As to the why, Cambodia was first influenced by Hinduism during the beginning of the Kingdom of Funan. Hinduism was one of the Khmer Empire's official religions. The main religion adhered to in Khmer kingdom was Hinduism, followed by Buddhism in popularity. Initially, the kingdom followed Hinduism as the main state religion. Vishnu and Shiva were the most revered deities worshipped in Khmer Hindu temples. Temples such as Angkor Wat are actually known as Preah Pisnulok (Vara Vishnuloka in Sanskrit) or the realm of Vishnu, to honour the posthumous King Suryavarman II as Vishnu.
The empire's official religions included Hinduism and Mahayana Buddhism until Theravada Buddhism prevailed, even among the lower classes, after its introduction from Sri Lanka in the 13th century. Since then, Hinduism slowly declined in Cambodia, and finally being replaced by Theravadan Buddhist as the major practice in the kingdom.