It is common in many cultures for a ruling class to practice both polyandry and polygyny as a way of preserving dynastic succession. In practice, this seems to have only been practiced by rulers, with common people maintaining a monogamous marriage. It seems that polygamy was allowed during ancient times. These texts support the view that in ancient India, sex was considered a mutual duty between a married couple, where husband and wife pleasured each other equally, but where sex was considered a private affair, at least by followers of the aforementioned Indian religions. The epics of ancient India, the Ramayana and Mahabharata, which may have been first composed as early as 500 BCE, had a huge effect on the culture of Asia, influencing later Chinese, Japanese, Tibetan culture and South East Asian culture. These ancient texts, the Rig Veda among few others, reveal moral perspectives on sexuality, marriage and fertility prayers. During this period, the first evidence of attitudes towards sex comes from the ancient texts of Hinduism. The origins of the current Indian culture can be traced back to the Indus Valley civilisation, which was contemporaneous with the ancient Egyptian and Sumerian civilisations, around 2700 BCE. Khajuraho Hindu and Jain temple complex is famous for erotic arts.
Moreover, there are distinct cultural differences seen through the course of history across India. As in all societies, there was a difference in sexual practices in India between common people and powerful rulers, with people in power often indulging in "self-gratification" lifestyles that were not representative of common moral attitudes. It may be argued that historically, India pioneered the use of sexual education through various art forms like sculptures, paintings, pieces of literature. India played a role in shaping understandings of sexuality, and it could be argued that one of the first pieces of literature that treated " Kama" as science came from the Indian subcontinent. The seeming contradictions of Indian attitudes towards sex (more broadly – sexuality) can be best explained through the context of history.