The story
The lanterns are the point and the reason is variously told: a Han emperor honouring the Buddha, a Daoist festival of the upper origin, or a village that lit the whole valley so the Jade Emperor would think it already burnt and spare it. All three have been believed at once for a long time.
Riddles are written on the lanterns to be guessed by whoever stops. Getting one right earns a small prize and the right to say so.
It was for centuries the one night unmarried women could walk out after dark, which made it China's older lovers' night — the one Qīxī now shares.