The custom of lighting lanterns on the Lantern Festival appeared earlier than this festival. During the reign of Emperor Wendi, because the emperor believed in Buddhism, it was stipulated that the court and the people would light lanterns to worship Buddha on the fifteenth day of the first month. As a custom of worshipping Buddha, this custom was maintained during the reign of Emperor Wendi. Later, after the death of Emperor Wendi, the new emperor designated the 15th day of the first month as a festival, and the habit of lighting lamps also became a way to celebrate.
Moreover, because "lamp" is homophonic with "Ding", Ding also means population, and adding a lamp represents "adding Ding". When a woman is newly married and childless during the Lantern Festival, her family will give her a lamp, which means that she hopes her daughter can get pregnant as soon as possible.