Calendars have 12 months due to ancient systems based on lunar cycles, which are about 29.5 days long. Twelve lunar cycles roughly fit into a solar year of 365.25 days. Early civilizations, like the Babylonians, used this division, which was later adopted and refined by the Romans. This structure balances lunar phases with the solar year, creating a practical system for tracking time, which has continued into modern calendar systems.