ID Numbers
The ID number of each Pokemon you encounter is determined at the start of the game and is randomly generated. A certain string of digits is correlated to your username, country and specific game to differentiate the Pokemon caught in your game from all of the other Pokemon out there. ID numbers also affect your Pokemon's stats. There is no way to change the ID number without the use of a cheating device such as a GameShark or Action Replay.
Lottery
The lottery in GoldenRod City matches the ID number of any Pokemon you have obtained with a randomly generated number that changes everyday. If you have traded Pokemon with other people, you will have Pokemon that have very different ID numbers and thus your chances of winning the lottery are raised. Trade with as many people as possible to increase your chances of winning the lottery.
Breeding
In addition to winning the lottery, if you have traded with someone who is not from your country, you can breed that Pokemon with one of your own Pokemon to increase the chances of hatching a shiny Pokemon. Shiny Pokemon are very rare, but this method, known as the Masuda Method, increases the chances of obtaining a shiny Pokemon. The game compares the ID numbers of the Pokemon and if the digits correlating to the country in which the Pokemon was obtained are different, the chances of hatching a shiny Pokemon is raised to 1 in 2,048.
Experience Points
Using the ID numbers, if the game sees that the Pokemon you are using is not from your own copy of the game, that Pokemon will receive more experience points after a battle. This is especially useful when you need to raise a Pokemon as quickly as possible. Traded Pokemon gain experience points at a rate that is 1.5 times faster than nontraded Pokemon. The catch is that if you do not have the correct badges to train your Pokemon, that Pokemon may not obey you. Each badge you receive from defeating a gym leader will raise the level at which Pokemon will obey you. If you have obtained all eight badges, all Pokemon will obey you.