What do QR Codes do in Pokémon Ultra Sun?

One further significant benefit of the QR code system in Pokemon Ultra Sun & Moon is the ability to perform a "Island Scan" after scanning 10 codes. Running this analyses the island you're on and discovers or causes the spawn of a rare Pokemon that is typically not seen in Alola, thereby causing it to spawn on that island.