Mechagodzilla is a powerful machine that, in all of its incarnations, was built with a single purpose in mind: to kill Godzilla.
In Mechagodzilla's first appearance in Godzilla Vs. Mechagodzilla (1974), the Simeons--ape-like aliens from the third planet of the black hole--created a robot made from Space Titanium to kill Godzilla. It was equipped with an endless supply of finger missiles; a cutter beam that could slice a mountain in two; and a eye beam that could pierce even Godzilla's skin. Mechagodzilla was originally disguised as Godzilla and wreaked havoc on Japan--even briefly fighting Godzilla's monster ally Anguirus--until the real Godzilla appeared and exposed the impostor with his heat ray, exposing the metallic fiend's true form. In their first fight, Mechagodzilla nearly Killed his organic counterpart; however, Godzilla regenerated quickly and, in their next bout, he had the assistance of King Caeser, a lion-like monster. At one point in the battle, Godzilla became a living magnet (due to being struck by a lightning storm during his recovery) and tore Mechagodzilla's head off.
In Terror of Mechagodzilla, Godzilla had to fight both a rebuilt Mechagodzilla and Titanosaurus, a 60 meter tall aquatic dinosaur (not to be confused with the actual dinosaur). This time Mechagodzilla had a new weapon: the revolver missile, which could send a city block flying. Godzilla managed to blow Mechagodzilla apart after a brutal fight, and send Titanosaurus fleeing.
In Godzilla vs. Mechagodzilla II (which took place in the Heisei era of films, in a separate continuity from the Showa period of 1954-75), Godzilla fought a Mechagodzilla developed by the newly-formed United Nations Godzilla Countermeasures Center. Here, he was built from the salvaged mechanical components of Mecha-King Ghidorah (killed in 1991's Godzilla vs. King Ghidorah); parts of it were also used to create the Garuda warship, which had the ability to combine with Mechagodzilla. The robot managed to actually mortally wound Godzilla by blowing up the monster's dorsal spines; however, Rodan, another monster who had been nearly killed earlier by Mechagodzilla, used his dying breaths to send his energy into Godzilla, reviving him and giving him the power to destroy Mechagodzilla with his spiral beam.
In Godzilla Against Mechagodzilla, the robot, called Kiryu in this incarnation, was a mechanical frame built upon the actual skeleton of the original Godzilla from 1954. It was operated by DNA computers, which would later cause problems during battles with Godzilla. When Godzilla roared, it awakened a primal instinct within Kiryu, causing it to destroy part of a seaside town. After the attack, the glitches were fixed, for the most part, though complications would arise later in the follow-up film Godzilla: Tokyo S.O.S (2003). In the film, after a long brutal fight with Godzilla, Kiryu used its Absolute Zero cannon to try and freeze Godzilla. While it did not freeze the behemoth, it did severely wound him to the point that he had a scar in his next appearance. In Tokyo S.O.S, Godzilla and Mechagodzilla fought to a standstill until Godzilla's roar awakened Kiryu's primal instincts again. Instead of causing it to go berserk again, it somehow made the spirit of the original Godzilla remember what it really wanted: to sleep peacefully at the bottom of the ocean. He then flew Godzilla into the Sea of Japan, where both monsters presumably fell into a deep, peaceful slumber.