The chronicles of the Chinese monk Xuanzang (also known as Hsuan Tsang), who travelled to India between 629 and 645 CE, during the reign of King Harshavardhana, provide the first recorded documentation of the Kumbha Mela. However, such ceremonies go back many centuries, which is when the river celebrations first began to organise themselves. Its roots may be traced back to one of the most well-known mediaeval puranas, the Bhagavata Purana, according to mediaeval Hindu religion. The Mahabharata, the Ramayana, the Vishnu Purana, and the Bhagavata Purana all make reference to the Samudra Manthan event (the churning of the ocean of milk).
According to the story, the curse of Durvasa Muni caused the Devas to lose their strength, therefore in order to reclaim it, they went to Lord Brahma and Lord Shiva. After praying to Lord Vishnu, they were told to churn the milk ocean, known as Ksheera Sagara (the primordial ocean of milk), in order to get amrita (the nectar of immortality), which they did (full tale on Kumbh Mela). In order to do this, they had to temporarily join forces with their fiercest rivals, the Asuras, promising to divide the spoils equally in the future. The Mandara Mountain served as the churning rod and Vasuki, the king of serpents, served as the churning rope for the purpose of churning the milk ocean. They churned the ocean for 1000 years, where demons were holding Vasuki's head and Gods were holding its tail. Finally after this entire churning process, Dhanwantari appeared with Kumbh in his palms.
According to Hindu mythology, the Kumbh Mela traces its roots back to a battle between the gods and demons over a pot of amrita, the elixir of immortality. To safeguard the amrita, it was entrusted to Gods Brahaspati, Surya, Shani and Chandra, but the demons soon learned of the conspiracy and attacked the gods. In order to prevent the amrita from falling into the wrong hands, the gods ran away with the Kumbh, which was chased by the demons for twelve days and twelve nights (equivalent to twelve human years). It is said that during this battle, drops of amrita fell at four places - Allahabad (Prayag), Haridwar, Ujjain, and Nashik. The Kumbh Mela is celebrated once every 12 years at each of these four locations, where the drops are believed to have fallen. At the historic moment of the Maha Kumbh Mela, it is believed that the river turns into sanctity spots filled with the primordial amrita. This religious festival is an essential event in Hindu culture and attracts millions of visitors from around the world.