There are many different beliefs about the origin of the Lantern Festival. But one thing for sure is that it had something to do with religious worship.
One legend tells us that it was a time to worship Taiyi, the God of Heaven in ancient times. The belief was that the God of Heaven controlled the destiny of the human world. He had sixteen dragons at his k and call and he decided when to inflict drought, storms, famine or pestilence（瘟疫）upon human beings. Beginning with Qinshihuang, the first emperor to unite the country, all subsequent emperors ordered splendid ceremonies each year. The emperor would ask Taiyi to bring favorable weather and good health to him and his people. Emperor Wudi of the Han Dynasty directed special attention to this event. In 104 BC, he proclaimed it one of the most important celebrations and the ceremony would last throughout the night.
Another legend associates the Lantern Festival with Taoism. Tianguan is the Taoist god responsible for good fortune. His birthday falls on the 15th day of the first lunar month. It is said that Tianguan likes all types of entertainment. So followers prepare various kinds of activities during which they pray for good fortune.
The third story about the origin of the festival is like this. Buddhism first entered China during the reign of Emperor Mingdi of the Eastern Han Dynasty. That was in the first century. However, it did not exert any at influence among the Chinese people. one day, Emperor Mingdi had a dream about a gold man in his palace. At the very moment when he was about to ask the mysterious figure who he was, the gold man suddenly rose to the sky and disappeared in the west. The next day, Emperor Mingdi sent a scholar to India on a pilgrimage（朝圣）to locate Buddhist scriptures. After journeying thousands of miles, the scholar finally returned with the scriptures. Emperor Mingdi ordered that a temple be built to house a statue of Buddha and serve as a repository for the scriptures. Followers believe that the power of Buddha can dispel darkness. So Emperor Mingdi ordered his subjects to display lighted lanterns during what was to ome the Lantern Festival.