He was created by the Didact to stop the Gravemind, and was somehow transported into his lair. Gravemind saw Mendicant as a threat, but also saw him as a potential weapon against the Forerunners. He offered to talk with Mendicant, and since there was so little information about the Gravemind in the Forerunner archives, Mendicant saw an oppurtunity to learn more about the Flood.
Gravemind told Mendicant everything. Everything the Gravemind knew about anything. Because the Gravemind is possibly the smartest thing in existance, this took a long time. 42 years, to be precise. The Gravemind made no attempt to turn Mendicant against the Forerunners, and he did not twist any information or even suggest anything. He just recounted his knowledge to Mendicant, who was slowly coming to his own conclusions.
Mendicant eventually decided to betray the idiotic Forerunners and attack their fleet. They hastily built a defense AI, Offensive Bias, to protect themselves, but faults in his programming made him a psycopathic maniac, who used his own ships as bombs to eradicate the Flood fleet. This did the Forerunners no good as it left them stranded on the Ark, and they eventually had to fire the Halo Rings anyway, even though this meant killing themselves.
Offensive Bias captured Mendicant Bias and took him back to the Ark for dismantling. He placed pieces of Mendicant Bias on each of the ships designed to reseed the Galaxy after its cleansing, so one piece of him ended up on Earth, one on High Charity and even one on Balaho.
Mendicant lost his connection with the Gravemind who, filled with remorse, retreated to the Dark Space. Mendicant's primary programming took over, and he diverted his attention towards another growing threat - the Covenant. The fragment of his AI on the Keyship at the centre of High Charity told the Prophets that they were meaningless and that Humans were the coolest. This made them angry however, and they threatened to destroy humanity. Mendicant attempted to flee in the Keyship but a group of Engineers cut the connection, effectively killing this fragment of Mendicant.
However, the main fragment placed on the Ark was still at large. Controlling the Ark's Sentinels it aided Johnny throughout his journey, it opened doors for him, it delayed the firing of the Halo Rings and it even attempted to communicate with him via Terminals. Mendicant Bias allowed the Covenant to be destroyed by turning the Ark's security systems against them. This fragment, however, was damaged when its old ally, Gravemind, crashed High Charity into the Ark. The subsequent destruction of High Charity killed off this fragment of Mendicant for good.
However, there are still many more Mendicant Fragments out there, waiting to be found and reclaimed...