Attacking a gym, or training at a gym?
I've found when attacking a gym held be an opposing team, a Pokemon is knocked out in the battle and requires a revive before administering potions. If you are training at a gym held by your team, a Pokemon is not knocked out, and only requires potions to regain health.
__________________
|