As a scientist, the man who would one day become known as the Brain experimented on animals to raise their intelligence. One of his experiments was when he captured a gorilla and experimented on it, raising its I.Q. to the genius-level of 178. He named the gorilla Monsieur Mallah and educated him for almost a decade before making him his personal assistant.
The Brain, explaining Mallah's origin in Doom Patrol #86
Ten years ago, I took a superior ape — stronger than any human... more agile than the best athlete! Through secret teaching methods and shock treatments, I gave it an I.Q. of 178! Genius status!
The scientist's colleague, Niles Caulder grew jealous of his work and arranged for the scientist to get caught in an explosion, which destroyed the scientist's body. Only the brain survived, and Caulder planned on putting his brain in a robot body.
Mallah rescued the scientist, taking his brain and transferring it to a computer network that kept it functioning. Now known simply as the Brain, the scientist and Mallah gathered together the criminal organization known as the Brotherhood of Evil in hopes of conquering the world and getting revenge on Caulder. Caulder, now known as the Chief, through a series of other accidents that he manipulated, would form the superhero group known as the Doom Patrol. Setting out to destroy the Chief's 'pets', the Brain, Mallah, and their Brotherhood became enemies with the Patrol. Their criminal activities would also put them into opposition with the Teen Titans.
During Grant Morrison's Doom Patrol run, Mallah had the Brain placed in
one of Robotman's bodies. In his new body, the Brain confessed to Mallah he
was in love with him. Mallah revealed he felt the same way, and the two
kissed. However, Robotman's body had developed sentience and vowed never to
be enslaved by a brain again; when Mallah placed his lover in the body, he
triggered a self-destruct mechanism, which exploded as they kissed.
The two would later resurface (the Brain back to floating in a jar). It is uncertain if the two somehow survived the explosion, or that they were brought back to life by some alteration of reality (in Zero Hour, the world was destroyed and recreated with subtle differences, and in Infinite Crisis, Superboy-Prime's pounding on the walls of reality created ripples which corrected reality and caused history to repeat itself for several characters).
Recently, the Brotherhood have been raiding genetic research facilities; their plan being to unlock the secrets of cloning in order to create a new body for the Brain, so he and Monsieur Mallah "can finally be happily ever after."