This tradition is actually a Fall Festival. The Fall Festival is come in date 15 month 8 in candra sengkala calender, in this day the moon at the fullest round shape, or it is call full moon. This event just happen once in a year, so people celebrate it by eat moon cake with family while saw the moon. There are many story that tell about background of this Festival, and one of them is :
In era which is there are 10 sun in earth, there are an archer god, Hou Yi with his wife Chang E ordered by God of the god to help people in earth because they are suffering from hot that come from 10 sun. Then Hou Yi instruct the 10 sun to come up one by one a day, but them ignoring the order. And then Hou Yi shoot one by one the sun, soon there are just one sun and the human thanks the god because now they not suffering again. But this meritorius make some of the god is jealous and slandering Hou Yi, and because the God of the god is believe it.
So, they are punished to live in earth. Hou Yi and Chang E live in earth by hunting the animal, and someday there are news about medicine that can make them to go to heaven. Then Hou YI find the medicine but this is just for one person, so he keep it home, because he love his wife and not want to be seperated. The day is goes on until someday Chang E accidentally found it and drink the medicine, so the Chang E is goes to heaven and live in Moon Kingdom.
Then Hou Yi and Chang E feel sad about this because they seperated now, and then Chang E ask the God of the god to allow her to be together with Hou Yi in heaven. The God of the god not accepted the request and say because love between Hou Yi and you is true, i will alow you be with Hou Yi when the Moon is at the nearest position on earth (it is in day 15 month 8), but after that you will be in moon kingdom and Hou Yi in earth again. Then Chang E accept that offer. So, people on earth celebrate that by eating moon cake with saw the moon, because thanks for their help and celebrate the day when Hou YI an Chang E meet.
And this day is Tong Ciu Pia, so we can celebrate it with eat moon cake with family, and remember meritous of Hou Yi and Chang E. Happy Tong CIu Pia Day.
source : various source