Running this scans the island you’re currently on and finds/spawns a rare Pokemon that usually can’t be found in Alola – in real terms making it spawn on that island.
The QR code system in Pokemon Ultra Sun & Moon does have one other major advantage: every ten codes you scan you’ll be able to run an ‘Island Scan’. Pokemon Ultra Sun & Ultra Moon Tips – How To Ash’s QR Code Pikachu