Cavity spintronics: foundations and applications of spin-photon hybridization