Historic note: In the original PC, the timer chip had three separate timers - it generated a periodic interrupt at 18.2 Hz for DOS, drove the speaker with another timer, and also did a third thing I can't remember.
Third is actually the first (timer 0): interrupt for the DMA controller to perform another DRAM refresh. Every couple of microseconds I think.
The 18.2Hz is used by the clock (at least when DOS is handling it, I think?). You can hijack the interrupt and use the count for something else (say, an in-game timer to trigger another frame of activity), but don't be surprised if your system time is running slow afterwards.

This, by the way, is precisely why, if a motherboard had a 555, it's not used to generate PC tones: the timer has a pin toggle mode which does it directly. Give or take a driver for the PC speaker (2" 8 ohm in the old fashioned models, usually some piss tiny piezo these days).
All this stuff was integrated first into a SuperIO chip (along with all the other system functions, and serial and parallel), then into the South Bridge when that become a thing. If your motherboard has a BIOS, it has all of this stuff in it somewhere; UEFI models may not, I don't know.
Tim