The 12-hour division seems to have come from ancient Egypt. While in the modern world we tend to learn and use a decimal number system (base ten), that was not always the case. Historically many cultures used a duodecimal system, also known as base twelve. It uses twelve as its foundational counting unit. Sort of like how our usual decimal system revolves around the number ten.