When you receive the eon ticket naturally, another part of the save file is modified to store a magic value (affectionately called 'herpesval' by PKHeX's source code, as it is transmitted from an infected user to another, making them an infected host). By viewing the source code, you can see what changes are being made.