One of the simplest clocks is made by connecting a Schmitt trigger to a resistor and a capacitor, like so

          |\   
      ----| \o-------- (clock)
      |   | /  |
      |   |/   |
      |        |
      |--\/\/\-|     
      |
     ===
      |    
     _|_    
      -
      
What happens is that the output of the Schmitt trigger (5v) causes the capacitor to begin charging, until the input voltage rises to a certain level, after which the trigger flips (to 0v), and the capacitor discarges until the trigger flips again to 5v, and the cycle repeats. The value of the capacitor, resistor, and the voltage levels that the trigger flips at are all factors in the output clock speed. This simple circuit gives a rough-and-ready clock signal, perfectly good for TTL circuits, and seen a lot in cheap consumer electronics.

There is, however, another factor that affects the clockspeed, which is especially relevent in battery powered appliances - The charging rate of the capacitor depends on the output voltage of the trigger, which in turn depends on the voltage of the power rail. If some component starts drawing a lot of current, the voltage of the power rail will drop, and the clock rate will slow. If the power rail drops too low, gates may start to behave erratically, and the machine may crash... Which is why a Big Mouth Billy Bass with low batteries will sing fine until the fish starts to look at you, and will get slower and sloooooower....

Taaaaaaaaaaake meeeeeeeeeee toooooooo theeeeeeeee riiiiiiiiiiiiiiveeeeeeeeerrrrrrrrrrr <pop!>