Well, there's a cutscene in X4 that shows Zero waking up in a capsule while Dr. Wily watches him wake. Then it cuts to Zero in a laboratory with a bunch of dead bodies on the ground, including one that looks like Auto, with Zero's hands covered in blood.
There's no official explanation, but the leading theory is that Wily built Zero and sent him on a mission to destroy Megaman and Light once and for all. He succeeded in killing Megaman, Roll, Dr. Light, Auto, Rush, etc., but in the fight Zero was disabled and lost his memory. X was probably built around the same time to counter Zero, but Light must have been unable to finish X in time to stop him. And that's about all we know until Capcom decides to, if ever, tie it all together.
There's no official explanation, but the leading theory is that Wily built Zero and sent him on a mission to destroy Megaman and Light once and for all. He succeeded in killing Megaman, Roll, Dr. Light, Auto, Rush, etc., but in the fight Zero was disabled and lost his memory. X was probably built around the same time to counter Zero, but Light must have been unable to finish X in time to stop him. And that's about all we know until Capcom decides to, if ever, tie it all together.