Why use the move detect/protect?
Protect/Detect are essentially a "blank turn", but end-of-turn actions still occur. Here are several reasons Protect/Detect may be used:
- Recovering HP if you are holding Leftovers (or similar set-ups like the move Ingrain).
- Ability gains such as from Speed Boost.
- Opponent taking damage from a burn or poison.
- Opponent taking damage from a weather condition.
- If the opponent is confused, there is an extra chance they could hurt themselves in confusion.
- Protecting against two turn attacks like Dig or Fly. Because those moves attack on the second turn you know they are coming and Protect will work every time.
- In double/triple battles, you can avoid damage from teammates using moves such as Earthquake or Surf.
- Wasting the opponent's PP. For moves like Hydro Pump that only has 5 PP (or max 8) it could be vital.
- "Scoping out" the opponent's moves - in other words, checking what moves your opponent has.
If one or more non-protect moves are used between each use of Protect/Detect (for example on alternate turns), they are guaranteed to work.
From Smogon:
Competitive Use
Detect is a stalling and more defensively inclined move. Like Protect, it should be used on defensive Pokemon, as a scouting move or for a free turn to gather Leftovers recovery. You will never see it in standard singles play, as it is totally outclassed by Protect, which has a superior distribution (every Pokemon that learns Detect also learns Protect) and much higher PP. However, in doubles play, Detect is far less likely to be affected by Imprison due to its lesser distribution, and is often used instead of Protect if the Pokemon has access to it.
The key idea is that it's a lesser used "Protect". It's essentially a lot worse than Protect, because more Pokemon can learn Protect over Detect (hence superior distribution). It also has less PP, meaning less uses for it.
Another use comes for Pokémon like Gliscor, Walrein, and Breloom that have abilities that let them recover 1/8 of their health per turn. Now suppose you use substitute on turn one and protect on turn two. You've now recovered 1/4 of your health: the same amount as it cost to make the substitute. This allows for up to 32 turns of stall. If you use toxic the first turn, you can just stall until they faint, then repeat until you run out of PP.