Ok here is what I think happnened.
At a certain point of health, the NPC'c will heal their Pokemon.
Lets say that response is at 15HP>. If they survive at a higher HP, then they attack, if you hit them at the correct 15>, then the game will make them heal their Pokemon.