The eggs in Pokémon Go offer various different Pokémon based on the type of egg it is. There are four distinct eggs, the three-kilometer, the five-kilometer, and the 10 kilometer are eggs you can receive as a reward for spinning Poké Stops and Gym discs. The seven-kilometer eggs are ones you receive from friend gifts, and they usually contain more uncommon and rare Pokémon inside of them. A fifth egg is about to join the mix, a red egg, and receiving these is a bit different. This item is also called strange eggs, and some are even referring to them as shadow eggs.
To obtain these eggs, you will need to defeat Team Rocket leaders to receive them. You can find a Team Rocket leader by taking down six Team Rocket grunts, obtaining enough mysterious components to create a Rocket Radar, and then track them down to the nearest Poké Stop. You may encounter Cliff, Arlo, or Sierra, and after beating them, the egg may drop as a reward.
You also need to have an open egg slot in your inventory. If you do not, you cannot receive the egg at all. It’s a good idea to double-check your pack to make sure you have room before engaging the leader. The egg has a chance to hatch a Dark or Poison-type Pokémon inside of it.