The Guardians were originally created by the Forerunners to oversee worlds they deemed troublesome. The Forerunners also attempted to use the Guardians against The Flood, but only proved to be ineffective against the parasite. The Forerunners later hid the Guardians on numerous planets throughout the galaxy.
Halo 5: Guardians
The Guardians were later awakened by Cortana to enforce the AIs' claim to the Mantle of Responsibility. Guardians soon activated on many human colonies, causing innumerable amounts of damage.
After their activation all of the Guardians moved to the planet Genesis, where from they were deployed to their designates systems. At least some of Guardians used their EMPs to disable any opposition upon arriving in their systems.
Halo Wars 2
When Professor Anders of the Spirit of Fire's crew commandeered a newly built Halo Installation in order to return to civilization, she is intercepted by a Guardian which forces the Halo out of slipspace
The Guardians will presumably return in Halo 6 as major antagonists.