The unit for all calendars is the day, the diurnal cycle of daylight and night. A lunar calendar is based on the monthly (synodic) cycle of the Moon’s phases. A solar calendar is based on the annual cycle of the Sun’s height above the horizon. A lunar-solar (lunisolar) calendar is based on the lunar month modified in order to match the solar (or sidereal) year. The solar-lunar calendar is based on the year but includes months similar to the lunar cycle.
“The lunisolar calendar, in which months are lunar but years are solar—that is, are brought into line with the course of the Sun—was used in the early civilizations of the whole Middle East, except Egypt, and in Greece. The formula was probably invented in Mesopotamia in the 3rd millennium bce.” (Encyclopedia Britannica)
The lunar and lunar-solar (lunisolar) calendars are the oldest calendar systems, and are still used in some traditional societies and religions. The Hebrew (Jewish) and Islamic calendars are examples of the lunar-solar calendar systems. Solar and solar-lunar calendar systems came from Egypt, Greece, and Rome. The solar-lunar month departs from the lunar month but combines to equal a year.
The question is why the Moon forms the primary cycle in some calendars, whereas the Sun forms the primary cycle in other calendars. The reason may well be that some societies think in terms of 3D time, whereas other societies think in terms of 3D space. The difference is that in 3D space the Earth revolves around the Sun and the Moon revolves around the Earth, whereas in 3D time the Earth revolves around the Moon and the Sun revolves around the Earth. In the former case the solar cycle is primary, whereas in the latter case the lunar cycle is primary.
When European societies considered the Earth to be the center of all celestial motion, their calendars were already established. So the correspondence between calendar systems and the dominant perspectives (spatial or temporal) applies to the original development of calendars.