Physical Layer: How do how frequency sources work?
It's called an oscillator and can contain a small crystal that does mechanically vibrate in the MHz range quite easily. Get above 100 MHz and crystals are starting to be ineffective in common oscillator circuits so an inductor-capacitor (LC) circuit can be effectively used well beyond 1 GHz. To obtain crystal-like accuracy and low drift a phase-locked-loop circuit is employed.

There are other oscillator circuits too but crystal and LC are the common ones covering the biggest range of frequencies someone may want to generate.