According to Wikipedia,
Grievous becomes a security chief for the Intergalactic Banking Clan. San Hill, leader of the clan, notices Grievous’ strategic genius and skill in battle. He is mentioned to the Confederacy of Independent Systems leader, Count Dooku. Led by Darth Sidious, the Sith Lords conspire to draw Grievous into the Separatist army. Despite Hill’s generous offers, however, Grievous refuses to lead the Separatist army.
During an attack by the Republic’s armies on the clan’s base, Grievous’ shuttle explodes and crashes. Grievous is mortally wounded in the crash, kept alive by a transfusion of blood from the deceased Jedi Master Sifo-Dyas, and Dooku’s mastery of the dark side; his shattered body is taken to the planet Geonosis, where most of it is replaced with a droid exoskeleton that complements his natural reflexes. Hill approaches him and offers him the chance to live again in a cybernetic body and lead the Separatist army. Grievous initially resists — he would rather die a warrior’s death than watch his body sustained by technology — but Hill eventually persuades him by appealing to his desire for revenge. In actuality, this was Hill’s plan all along, as the Separatists had booby trapped Grievous’ shuttle themselves, meaning to leave the General with no other choice than to accept. Dooku then trains him in lightsaber combat until he is one of the best duelists in the galaxy, and whips his resentment of the Jedi into a frenzy. The metamorphosis is then completed, leaving Grievous one of the most fearsome warriors of the Separatists’ army.