This happens a lot with normal battles, usually involving dodging or one pokemon dealing a killing blow just before the other deals damage, but it is just more obvious when a pokemon faints or doesn't faint because of it.
I think the game client side is making predictions about how much damage is being dealt, but when it updates with the game server side small corrections are made. Usually the difference seems to go in the player's favor (or maybe it is just not as obvious when it goes against), such as you dodging but still having your HP go down, then the game deciding that you did in fact dodge in time so you regain 75% of the HP you just lost (since you should have only taken 25% damage for dodging).
This issue does seem to be more prevalent with worse connections.