If you can count to 12hrs, then you should be able to count to 24hrs. So what is the purpose of having the day numeration reset after 12? Military time is 24hrs, so they must have realized something is better/more accurate about it.
AM and PM are the abbreviations for Ante Meridian and Post Meridian. Ante (or Anti) is from Latin for 'Before' and Post is 'after' (or following). The Meridian, or middle, is noon; when the sun is at its local high point. The 12 hours of the day where originally devised by the Ancient Greek Astronomer Ptolemy in roughly the second century (AD/CE). Ptolemy originally divided the NIGHT sky into 12 hours for astronomical purposes and not so much for accurate time keeping. The use of 12 has to do with the the mathematical properties of 12; it's a highly divisible number.(i.e. 12 divides into 2 groups of 6, 3 groups of 4, 6 groups of 2, etc.) It's easy to divide a circle into 12 even sections so that's what Ptolemy did to the 'circle' of the sky. It's also easy to do the same and make a sun dial! twelve plus twelve is 24, so there is the 24 hour day. The length of a day, or one revolution of the Earth around it's axis, is not actually 24 hours but 23 hours, 56 minutes and 4 seconds; and slowing! (Due to the Moon's gravitational pull; It's essentially acting as a break) Incidentally, the idea of a fixed and uniform measurement of time is very modern. Because of the angle of Earths' Axial tilt the length of the days change seasonally (but not at the Equator!). So in the winter the length of an hour was shorter in the winter months then in the summer months.