Warning: this answer contains spoilers for both Venom: Let There Be Carnage and Spider-Man: No Way Home.
Eddie's initial transference to the MCU seemingly occurred in the mid-credits scene of Venom: Let There Be Carnage.
Eddie is lying on a bed watching a soap opera on television, when the symbiote mentions that it has a past that Eddie doesn't know about, including "80 billion light-years of hive knowledge across universes".
It decides to give Eddie a taste of this knowledge, and just as that happens, there's a distortion effect around the room, and Eddie suddenly finds himself lying on a bed in a different room, where J. Jonah Jameson is on TV, reporting on the reveal of Spider-Man's secret identity.
Eddie then assumes his Venom form, walks over to the TV screen -- which is showing a close-up of an unmasked Spider-Man's (Tom Holland's) face -- and the symbiote says "That guy..." and licks the screen, possibly signifying some degree of recognition.
SYMBIOTE: Oh, I love this show.
EDDIE BROCK: Yeah.
SYMBIOTE: Maximiliano’s feelings are not being validated.
EDDIE BROCK: Yeah, well, he never should’ve kept such an insane secret, man.
SYMBIOTE: We all have a past, Eddie.
EDDIE BROCK: What, are you… you hiding stuff from me?
SYMBIOTE: 80 billion light-years of hive knowledge across universes would explode your tiny little brain.
EDDIE BROCK: What-what does that even mean, man?
SYMBIOTE: Well, let me give you a taste, then. Just the smallest fraction of the things we symbiotes have experienced.
EDDIE BROCK: Okay.
SYMBIOTE: Ready, Eddie?
EDDIE BROCK: Yeah.
SYMBIOTE: Whoa. What’s happening?
EDDIE BROCK: No, no, no, no. No, no, no, no, no.
SYMBIOTE: What the hell is that?!
EDDIE BROCK: Oh, that’s a… that-that’s just a towel. Where are we? Wh-What did you do?
SYMBIOTE: It wasn’t me.
J. JONAH JAMESON [on television]: Incredibly, this shocking revelation brought to life by yours truly has only raised…
EDDIE BROCK: What? What-what... what is this?
J. JONAH JAMESON [on television]: …of Peter Parker, aka Spider-Man, aka the Spider Menace. But rest assured, dear viewers, we here at The Daily Bugle will...
SYMBIOTE: That guy...
Venom: Let There Be Carnage (2021)
The implication of all this seems to be that the symbiote -- through a hive mind link with symbiotes in other universes -- had knowledge of the Peter Parker/Spider-Man of another universe, and that when it shared this knowledge with Eddie, both of them unwittingly became subject to the spell cast by Dr. Strange in Spider-Man: No Way Home.
Variety recently published an interview with Spider-Man: No Way Home screenwriters, Erik Sommers and Chris McKenna, and McKenna confirmed that the symbiote was aware of the connection between Peter Parker and Spider-Man, through its knowledge of other universes.
Speaking of biting, the screenwriters say that including Eddie Brock and his alien symbiote Venom in the film’s final battle was “definitely discussed.” The pair confirmed that Watts directed the post-credits tag on “Venom: Let There Be Carnage,” which showed Brock zapped into the MCU. But Brock was ultimately relegated to the “No Way Home” post-credits scene instead. As for how a character who had never met any Peter Parker, let alone Spider-Man, could be pulled into the MCU by a spell specifically drawing people who had to know Peter Parker was Spider-Man? “The idea is that the symbiote has knowledge of other universes. Buried in his brain is some knowledge of that connection,” McKenna said.
‘Spider-Man: No Way Home’ Screenwriters Explain All Those Surprises and Spoilers: ‘This Wasn’t Just Fan Service’