In English, we use the word “second” to refer to two things that don’t seem to be related. “Second” means both “the rank after first” and the 60th part of a minute. It’s the same in Spanish, but I’m not aware of other languages with the same pairing of meanings. “Second” as the unit of time is the newer usage, since we’ve only been measuring time that finely for a few hundred years. How did we come to use the word that way?
The unit of time is called "second" because we get it on the second division of the hour by 60. The "second" as in "second division" derives from the Medieval Latin "secunda".
Second (n. 1)—from Old French seconde, from Medieval Latin secunda, short for secunda pars minuta "second diminished part," the result of the second division of the hour by sixty
It is from the Latin expression “secunda pars minuta.”
one-sixtieth of a minute of degree," also "sixtieth part of a minute of time," late 14c. in geometry, from Old French seconde, from Medieval Latin secunda, short for secunda pars minuta "second diminished part," the result of the second division of the hour by sixty (the first being the "prime minute," now called the minute), from Latin secunda, fem. of secundus "following, next in time or order".
In addition to what others have already mentioned about seconds being the second division of the 'hour' time unit, the details get slightly more interesting when you start to recognize that some symbols you may be familiar with today are actually numerically stating what level of subdivision you are talking about.
The division of the hour into sixty fragments is from the Babylonians and Sumerians who used a (sorta) base-60 numeral system (whereas now, we use base-10). Likewise 360 degrees also come from the same culture - breaking up the year into 360 days (with their less accurate calendars).
When writing hours and minutes and seconds in shorthand, we used to use what looked like tally-marks:
hour = ° (zero) minute = ' (one) second = " (two)
Actually, these 'tally-marks' are Roman numerals, with zero added later in the Middle Ages. This is what the degree symbol ° is: a zero, meaning zero levels of subdivison. And one subdivision (1/60th) of precision finer is roman numeral I, as ', followed by another subdivision ", which is Roman numeral II, and so on. These are Prime symbols, used to denote degrees of subdivision (degree, arcminute, arcsecond, etc)
To specify one-sixtieth of a second, you'd write roman numeral three: III. For one-sixtieth more precision, you'd write IV.
In the case of a circle, there are 360 degrees in the circle. In the case of a day, there are 24 degrees (hours) in the day. Going one level more precise, we can specify a degree of 45°45'45", which is the equivalent of saying 45.7575 (45/60 = 0.75).
This has mostly fallen out of favor in modern times (we now more commonly use 0:00:00.0), but persisted for a while for lap-times on stopwatches (e.g. a lap of 0°24′22″12‴ is zero hours, 24 minutes, 22 seconds, and 12 sixtieths of a second). It is still in semi-common usage for marking feet and inches: 2'5" (two feet, five inches), indicating subdivisions (from yards, which would be °), though they aren't subdivisions of sixty.
You'll still also see this format of subdivision used for GPS coordinates, which specify position using longitude and latitude, and the old sub-dividing circles (in this case, around the earth), into degrees, arcminutes, and arcseconds.
This is the Whitehouse's position using the old global coordinate syntax:
N 38°53′55″ W 77°2′13″
Though, we're moving away from that too, instead using decimal fractions of degrees:
It's worth mentioning in passing that "thirds" (as 60th divisions of a second) seem to be a legitimate, if little ever used, concept.
The "second" itself (as a standard unit of time or angle) mainly seems to have emerged only in the Early Modern period, when technology began to allow established units to be routinely measured to a finer scale than minutes.
I'd locate it around the time when developments in optics were enabling better angle measurements in professions and trades like astronomy, navigation on the high seas, and inland surveying.
Before the late 17th century, clocks didn't even have minute hands, let alone second hands, so it seems credible to think that the measurement of angle was the place where the need first arose to employ "seconds".
A "minute" etymologically simply means a smaller part (of a first-class unit, such as the hour or the arc-degree).
Given the minute based on 60ths, and existing familiarity with handling 60th divisions, a plausible extension thus appears to be to divide the minute up by the same ratio for a second time (that is, one more time than the first such division into minutes), and this approach for measuring angles became established in that Early Modern period before the widespread adoption of the decimal system (with tenths, hundredths, and thousandths) provided a different alternative to continuing further with "thirds" and "fourths".
I've seen some claims that the "second" can be traced as far back as the Babylonians, but whilst they had various divisions of angle and time, and quantities like 60 and 360 often feature in their mathematics, the modern "second" does not appear to be related in either the quantity it reckons (the Babylonian system was not 360/60/60 or 24/60/60), or etymologically. It's a unit that has been independently conceived and adopted since.
There is also a strong synergy between time and angle, not only because time has often been physically represented as angles on analogue clock faces and sundials, but because one of the main users of the finer measurements of angle was always astronomy, which itself has always been an activity closely connected to the measurement of time, so the measures - and words for those measures - which have been found suitable for measuring angle, have also been found suitable for measuring time.