If you are on fire or poisoned and inside of another player, you will be "pushed" out of that player everytime you take damage.
MC-1787 Able to be pushed by mobs / players when taking damage