A number of popular legends are related to the Rathayatra festival.
According to a widespread belief, the origins of the festival can be traced back to Lord Krishna, the eighth avatar (incarnation) of Lord Vishnu, who is said to have appeared in his human form on earth in 3228 BC. Lord Krishna is held to be the supreme God in Indian Hindu Mythology and hence, he is often worshipped as Jagannath (meaning "master of the world"). The Jagannath temple of Puri is dedicated to the worship of Lord Jagannath(Lord Krishna), his elder brother Balabhadra and their sister Subhadra. Just two kilometres away from this temple is situated another temple called "Gundicha Mandir" or "Gundicha Ghar". Gundicha Ghar is supposed to be the home of the aunt of Lord Jagannath. According to a legend, Lord Jagannath once expressed his desire to visit his birthplace Gundicha Ghar once every year for a week. And true to his wish, every year he spent seven days at Gundicha Ghar along with his elder brother Balbhadra and younger sister Subhadra. The Ratha Yatra festival commemorates this annual journey of Lord Jagannath to his aunt's residence along with his brother and sister.
During Ratha Yatra, the Jagannath temple of Puri becomes the centre of all activities. A majestic structure of 65 metres in height, the temple was built during the twelfth century A.D. in the Kalinga style. It houses three splendid wooden idols of Lord Jagannath(Lord Krishna), Balabhadra and Subhadra. Every year during the festival, the idols are taken through the streets of Puri on beautifully decorated wooden chariots and journeyed to the Gundicha mandir where the idols of the deities are dismounted from the chariots and taken inside. After a week, the deities are returned back on chariots to the Jagannath temple. There is an ancient legend describing how the images first came to the temple. The story goes that a long time ago, a few years after the great Mahabharat war, a king named Indradyumna lived in Avanti, the capital of Malwa of which he was the ruler. His chief minister Vidyapati had a dream where the god Nilamadhava was in a temple situated in a deep jungle jealously guarded by a tribal chief on an island known as Swarn Deep, in Udra Desi (Orissa), beckoning to him to come there. Vidyapati told the king about this dream and was soon dispatched to that town to find out why the good Lord had come in his dream. Vidyapati took two years to reach Nilakandara. To his dismay he found that v deity had vanished from the temple. This upset everyone, particularly Indradyumna. Still, he decided to perform the Ashvamedha Yagna on the shores of Udra Desi. During the yagna he heard the voice of Lord Nilamadhava asking him to look for a piece of wood with special divine specifications marked on it. When all the rituals of the yagna were completed they saw, to their amazement, a log of wood floating near the shore which they discovered was that of the neem tree. The presence of some strange markings on it convinced them that this was the divine wood they had been told of. At this very moment a man walked in and introduced himself as a carpenter. He said that he was the fittest person to be entrusted with the task of shaping the wood, as he understood the sacred markings. He, however, put some conditions before the king. He said that he should not be disturbed while executing the task and no one should enter the chamber where he would work without eating or drinking or sleeping for eight full days and that he should himself open the door when the task was completed. The king agreed and the carpenter went inside the room with the log of wood and shut himself in. When four or five days passed without a sound coming from the room, the king got apprehensive and ordered his men to open the door. The door was opened and the king found, to his surprise, no one inside except four half finished idols.
Even today, everyone believes that it was Lord Krishna who had come as the carpenter and fashioned the idols. They remain so even when remade. They had no hands or feet and so they remain to this day. New ones are only made in a year which has two Ashads and this happens every 12 to 19 years. This event is known as Nav Kalever. The idols are designed exactly as the original and painted also in the same manner. The chariots are mended every year since they lie out in the open.
Another fascinating legend tied in to the Ratha Yatra festival tells of the ancient monarch of Puri, Purshottam Dev. The king was fascinated by Padmavati, the daughter of the king of Kanchi of the South, and wanted to marry her. The father of the girl was unwilling to marry her off to the king of Puri. Not one to give up so easily, Purshottam went into battle with the king of Kanchi. But he lost the war. This made him very angry. He prayed fervently to Lord Jagannath, and again went to war with the neighbouring state. With the blessings of the Lord, he won the war this time. But such was his indignation at the defeated foe that he declared that he would take Padmavati to his kingdom and marry her off to a chandal (the lowest of the low caste). But before he could find a chandal the festival of Rath Yatra came about and the king got busy making preparations for the festival. He had to perform the rituals that he, as the king of Puri, had to perform. As was the custom, he took a broom and began to sweep the path in front of the chariots. The head priest was a very intelligent and pragmatic person; he knew that the king's daughter must not be insulted. So he quickly declared that since the king was doing the work of a chandal he was now a chandal himself and as such could marry the daughter of the defeated king, and so the princess was married to the king of Puri.
Another stirring tale related to the festival is found in the Bhagvat Purana (Hindu scripture) and tells how Kansa, the maternal uncle of Lord Krishna, sent Akrur to bring the Lord and his elder brother Balram, to Mathura from Gokul. His intention was to kill the two brothers as a divine voice had warned him of his death in the hands of Lord Krishna. When the brothers were ready to leave for Mathura, the Gopis and Gopals - childhood friends and playmates of Gopala (Lord Krishna) blocked the way of their chariot. When the Lord consoled them and allayed their fears, they bid him a weepy and painful farewell. The Festival of Rath Yatra is said to commemorate this incident of overwhelming separation.