The Custodian was an immense and ancient computer on the legendary planet Aldea. The Custodian was created by the Aldean progenitors hundreds of centuries ago when the Aldean civilization achieved enlightenment and retreated from the rest of the Milky Way Galaxy.
The Custodian maintained the planetary defense system, including a planet-wide cloaking device and defense shield, as well as a powerful repulsor beam. By the late 24th century the Aldeans themselves had forgotten how the system worked or how to maintain it. This lack of knowledge, combined with the cumulative environmental effects of the system, led the Aldeans to misdiagnose the sterility affecting their species as a genetic disorder. When the ultimate cause was revealed as their planet's defenses, the Aldeans de-activated the cloak and shield and set about relearning their own technology. (TNG: "When The Bough Breaks")