What is a QR code?
A QR (Quick Response) code is a two-dimensional barcode: a grid of black and white squares that encodes data a camera can read in a fraction of a second. Unlike the barcode on a product at checkout — which only reads left to right — a QR code reads in two directions at once, which is why it can pack in far more information: a full URL, a contact card, WiFi credentials, or a few hundred characters of plain text.
Every QR code has three large squares in three of its four corners — the finder patterns. That's the first thing a scanner looks for; it's what tells the camera “there's a QR code here, and this is its orientation,” even if the code is rotated or viewed at an angle. Everything else in the grid is the actual encoded data, laid out in a pattern defined by the QR code standard (ISO/IEC 18004).
The format also builds in error correction — extra redundant data mixed into the grid, so the code still scans correctly even if part of it is smudged, torn, or covered by a logo. That's why you can print a logo in the middle of a QR code (RubyQR supports this directly) and it still scans: the error correction absorbs the loss, up to a limit that depends on the correction level chosen at generation time.
When a phone camera scans a QR code, it isn't sending anything anywhere by itself — it's just decoding the grid back into whatever text was originally encoded, then handing that text to the operating system. If the text is a URL, the browser opens. If it's a WiFi network descriptor, the phone offers to join the network. If it's a vCard, it offers to save a new contact. The QR code itself is just the container; what it does depends entirely on what's inside it — see the 12 content types RubyQR supports for the full list.