In pre-Hispanic times, the Mexica (Aztec) civilization celebrated the birth of the god of war Huitzilopochtli by breaking clay vessels which contained fruit, such as oranges & fragrant plants.
The tradition of Piñatas came from China, where they used to break them to celebrate the new year.
Arrived in Mexico, in the XVI century, after having arrived in Italy and Spain, it was used by the Catholic missionaries to evangelize the New World:
Hitting the Piñata with the eyes hidden by a strip symbolizes faith; the contents of sweets and fruits represent the bounties and riches of heaven.
The authentic shape of the Piñata is a star with 7 sides (peaks) which symbolize the seven deadly sins.
Did you hit a piñata?