There are three moves in the game that put what are called ‘entry hazards’ on the opponent’s side of the field- Spikes, Toxic Spikes, and Stealth Rock. These moves can be used to devastating effect- or they can wind up negated laughably, if your opponent is specially prepared for them. Like any strategy, though, they have their place, and it is quite possible to orient an entire team around them.
Spikes is the most basic of the three entry hazards. You can lay up to three layers of Spikes on the opponent’s side of the field, and whenever a pokemon enters battle on their side for any reason, if it does not fly or levitate it will take damage- 1/8 of their maximum HP for one layer, 1/6 of their maximum HP for two layers, and 1/4 of their maximum HP for three layers. While this is a hefty amount of damage, it is set in stone and cannot affect pokemon that are not on the ground. Despite that, it is still a useful effect- but it takes one of the heftier defensive pokemon to really lay down enough Spikes to make them count hard.
Toxic Spikes is the second entry hazard, introduced back when Spikes came in. You can lay one or two layers of Toxic Spikes on the field- the first layer will cause incoming pokemon that do not fly to become Poisoned, and the second will improve the effect to Badly Poisoned, a form of poison that doubles in damage every round while the pokemon is on the field. Toxic Spikes behaves mostly like Spikes does- it has a static effect level, and only affects non-flying pokemon that come into battle on your opponent’s side. However, Toxic Spikes has two caveats. First of all, it does nothing to Steel-type pokemon, since they are immune to Poison status. This isn’t so bad, and kind of expected of them. More notably, though, if your opponent sends a non-flying, non-Levitation pokemon of the Poison type into the battle, not only will it not be Poisoned thanks to its immunity to that status, it will also ‘absorb’ all the Toxic Spikes, clearing them from the field. Thus, while the Poisoning effect of Toxic Spikes is strong, it is even easier to counter than Spikes.
Finally, there is Stealth Rock. This Rock move sends out flying rocks into the opponent’s side of the field- which deal 1/8 of the opponent’s health in damage to them when they enter the field. Stealth Rock can only put out a single layer of hazard- either there are Stealth Rocks or there aren’t. However, it has two things that make it stronger (and sometimes weaker) than Spikes. First of all, the damage is Rock-typed. This means that it’s altered by a pokemon’s weakness or resistance to Rock moves- so while a Rock/Steel pokemon will take only 1/32 of its maximum HP in damage, a Bug/Flying pokemon will lose a whopping quarter of its maximum HP on switching in to Stealth Rock. Which also brings us to the second part of Stealth Rock- since it floats in the air, it also affects flying pokemon.
All three entry hazards suffer from the same method of removal- Rapid Spin, a very low-powered attack that exists for the sole purpose of clearing entry hazards from its user’s side of the field. Curiously, since Rapid Spin is a Normal-type attack and not a special-effect move, it can be stymied by swapping to a Ghost pokemon, which cannot be hit with Rapid Spin and therefore prevents the move from clearing away entry hazards. Still further, Rapid Spin is a weak attack and not present on all too many pokemon- so while you do need to keep an eye out for it, it isn’t likely to show up too often unless entry-hazards are common in your playing environment.