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 beneath the crust numerous planets throughout the galaxy. An exeption to this measure was the one placed on Sanghelios. It was merely submerged in shallow water, and was one of numerous Forerunner constructs on the planet left totaly unhiden. The Covenant apparantly had some limited knowlege of the Guardian's function which lead them to worship it, while praying for it's eternal slumber. The AI's installed within Guardians while relatively simple in design were noted to develop strange personalites and habits. Notably it was these AI's who constructed the "faces" on the Guardians which unnerved even the Forerunners. However, any atempt by Forerunners to remove these faces were unsucessfull.
Halo 5: Guardians
The Guardians were later discovered by Cortana, and reactivated to enforce the AIs' claim to the Mantle of Responsibility. Guardians soon activated on many human colonies, causing innumerable amounts of damage. Before the Guardians awoke, however a human cult leader by the name of Dasc Gevadim discovered the Guardians and made them the focus of the cult. He lead his members to the location of one Guardian where they were presumably wiped out by the machine's activation.
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. The one assiged to earth engaged in a brief battle against the UNSC fleet above Syndey, Australia before deploying its EMP.
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.