Maximilian is a cyborg, with parts of Frank McCrae inside himAfter Hans Reinhardt quashed the mutiny with the robots, killing McCrae and proceeding to lobotomize the crew into human drones, he faced the problem that not all humanity could be removed from them (for example, they still held funerals); most of all, many still didn't obey his commands. So, he salvaged the body of Frank and put it into a robot he had already built for himself and used against the mutinees, with an ESP implant in the brain - the novelization explains that the psychic link between Kate and Vincent wasn't paranormal but thanks to technology - to issue commands to the former crew, who in their state would still recognize McCrae: Maximilian was born.Over time, however, Maximilian started to become erratic, sometimes even menacing towards Hans who, in horror, may have realized that deep within the robot, something of Frank was still alive and rebelling against him; in his hubris, Hans had put no failsafes, so he had to live in constant paranoia, causing a further toll on his already damaged mind. Maximilian/Frank was not fully self-aware though; he didn't recognize his daughter, and sometimes his disobedience was expressed in the worst ways, like when he killed Durant against Hans' wishes.At the end of the movie, when Vincent drills him, Maximilian lets out an unexpected, anguished scream, a sign the organic part inside him has been hit; Frank is now dead once and for all. The mechanical part of Maximilian takes over, activating a protocol to protect his master, and finds the only way in that situation: putting Hans inside itself. And so, as we can see in the final scene, Hans is condemned to a Hell he brought unto himself, while Frank is finally free and can go to Heaven.
WMG / The Black Hole