You see crystals on most circuits out there to provide accurate timing functionality to a microcontroller. Some people mistake them for devices which provide square wave “clocks” to uCs. That is not true. Quartz crystals are piezoelectric materials which can exhibit mechanical resonance. The frequency of the vibration of the crystals can be fine-tuned to a range of values out there by altering the mechanical shape and size of the crystals. Think of them like tuning forks which can be varied in size to create their desired tuning frequency. They are just passive devices which can vibrate when energy is given to them. The electrical equivalent circuit of a crystal consists of an RLC circuit with 2 resonance frequencies.
In most uCs, you have the option to connect these crystals next to the chip and these pins feed to a feedback amplifier. External Crystal + Internal Amplifier together gives you a Pierce oscillator generating an accurate waveform which is further fed to subsystems for generating your square wave clocks for timing. In most cases, you would have to add a couple of load capacitances to ground for these crystals to get the accurate freq. Do refer to the datasheets of devices to calculate these ones. Atmel has an excellent tech note on it. Startup is another consideration. It’s the time needed for an oscillator to start producing the freq at the correct amplitude after power-on. Think of it as a feedback amplifier initially taking noise as input and taking a few milliseconds to get to its steady state of actual output freq. This has high implications in low-power circuits where you want to conserve every bit of power during turn ON.
You also get oscillators as standalone chips which can be used to directly connect to your micro bypassing the internal amplifier by changing software fuse settings in the uCs. You also have something known as ceramic resonators. These are similar to quartz crystals but made of ceramic material and can also be tuned to a range of frequencies. It’s cheaper but poor Freq accuracy. Deviation of 10-50ppm for quartz & 5000ppm for ceramic.