This isn't really clear, and as Gab says, they're not served at weddings in Mexico. The cookies probably came to Mexico with colonizers and became part of the local cuisine over time.