We don’t want to get too technical here, but you can put a logo or some other image into a QR code because of something called “error correction.”
A certain amount of a QR code can be damaged or obscured and the code will still be scannable. That is why you can put an image over a small part of the code and it will still work.
The error correction is possible because QR codes utilize Reed-Solomon error correction, which is a type of error correction tool that is common in digital communication. It basically makes a copy of the code to fill in any missing or obscured pieces.
(We’ll talk more about error correction later.)
Please visit this page for an in-depth guide on how QR codes work.