There's meaning behind these molds and why they're made out of sugar. It all dates back to the Spanish conquest. While a tradition of honoring the dead already existed in Mexico at the time, the Spaniards brought about new learnings and customs and with that the idea of molding decorations from ingredients easily available. Sugar was accessible to Mexicans at the time, even those with little money, so it was a natural choice. Once they learned that they could make these skull molds with the ingredient and water (that's all it really is), the idea of the sugar skull evolved and grew to be an important symbol of the day.
Going back to the altar, skulls are placed as decorations to recognize the person who has passed. His or her name is written on the sugar skull's forehead and, depending on the age of the deceased, the size of the skull might vary — baby skulls are dedicated to those who passed at a young age and larger skulls are for adults.