This FAQ article covers the QR code that can be displayed in the app (and is used to confirm a contact’s identity and add their Threema ID at the same time; green verification level), not to be confused with the QR code on threema.id websites (which can only be used to add contacts; red verification level).
Scanning QR codes is a means for confirming contacts’ identities. That way, man-in-the-middle attacks can be effectively prevented: If you receive a message from a confirmed contact (i.e., verification level 3), you can be sure that it wasn’t spoofed or read by a third party (provided said contact’s device wasn’t stolen or hacked). On top of that, scanning someone’s QR code is a convenient way of adding them to your contact list without having to manually enter their ID.
Display your own QR code
Scan a contact’s QR code
If you are having trouble scanning a QR code, please make sure the camera is not too close (below 10 in/25 cm), which might prevent it from focussing.