From Bulbapedia, the community-driven Pokémon encyclopedia.
An outsider Pokémon is a class of Pokémon in the Pokémon games that is not originally from the same game cartridge as the player.
A Pokémon is recognized as an outsider if its Original Trainer identification does not match up with the current saved game. This means that if a Pokémon is traded out of a game that is later restarted, and the Pokémon is traded back in, it will be treated as an outsider.
While appearing no different to any Pokémon caught by the player (apart from the OT name and Trainer ID), an outsider Pokémon may behave in a different manner to those found in-game. If the Pokémon Trainer in possession of the outsider Pokémon has less than sufficient Gym Badges, the outsider may choose to disobey commands in battle. This can range from using a different move from the one instructed, "loafing around", or even taking a nap.
The in-game reasoning provided for this is that Pokémon respect Trainers who have defeated Gym Leaders: thus, by earning more Badges, a player will gradually cause an increased number of Pokémon to listen to him or her. Mechanic-wise, however, this rule stands to prevent someone from trading in a high-leveled Pokémon trained on another game, and easily beating their game.
While there is a chance that the Pokémon will not listen to its new Trainer, it will grow faster once traded. Outsider Pokémon gain 1.5 times the normal experience points awarded for participating in battles; outsider Pokémon from other countries will gain 1.7x the normal experience. This is denoted in-game with "Pokémon gained a boosted X Exp. Points!"
Even if two different saved games have the same Trainer name, and (although rare) a matching ID number, Pokémon from the games may be outsiders to each other because of a third value: a hidden, secret ID. In the event that all three values match, the Pokémon may be traded without being classed as outsiders. This has a 1 in 4,294,967,296 (232) chance of occurring.
Methods of obtaining outsider Pokémon
Outsider Pokémon can be obtained in a number of ways. If the player has multiple game packs and game systems, a Pokémon may be exchanged in a trade. Trading is possible in-game, as well, and each main series game has a number of non-player characters who will trade one of their Pokémon (which may or may not be otherwise obtainable) for one of the player's.
Sometimes, non-player characters will give out Pokémon with no exchange: usually, though, these Pokémon will have the same ID and OT name as the player. In some instances, however, such as Randy's Spearow in Gold, Silver, and Crystal and their remakes, HeartGold and SoulSilver, the Pokémon given to the player will be recognized as an outsider, and thus have the experience boost and potential disobedience.