The CMB is a snapshot of the oldest light in the universe, imprinted on the sky when the universe was just a baby in cosmic terms.
It is essentially the afterglow radiation from the hot, dense state of the universe just 380,000 years after the Big Bang, a time known as the recombination era. At this point, the universe had cooled enough for protons and electrons to combine into neutral hydrogen atoms, allowing photons (light particles) to travel freely for the first time without being constantly scattered by charged particles.