I'm not sure how it happened. I think what is happening is that the Alyx NPC that you saw through the moniters somehow got sent to my position when I entered one of those zones that loads the next part of the level. This actually happened to me twice. The first time it happened when I just split up with Alyx. The second time is when I entered another loading section with Alyx (the real one) following me. When I saw the two of them, I was thinking, "Cool... wonder if they'll both fight along with me." Once I entered the doors around of me and ran into a squad of combine troops, only the real Alyx fought back. The "fake" one just stood there doing nothing. After the fight was over, I decided that since the fake one was useless, I'll just kill her (the real one had her gun out so I could tell she was the fake one). However, after shooting with my shotgun, she took no damage at all. Because of that, I just figured "meh... I guess I'll just let her tag along and hope she gets lost". Well, she did just that after walking into the next room.
The cake is a lie... THE CAKE IS A LIE!!!!!