In player vs. player designated zones, you will still be viewable and attackable by players, but you are not left completely defenseless. While engaged in a Pet Battle, any attack from another player will break you out of the battle. You will receive a 3 second damage shield that will absorb 50% of incoming attacks. The same exact wild pet that you were previously battling will respawn after you come out of combat with the other player. However, if you defeated the primary pet in battle prior to leaving the match, the pet and its team will not respawn.
Most people come here not to read walls of text, they look for the better-rated strategies that match their pet collections, copy&paste stuff they need to import into their addons and only come back if something goes horribly wrong and then mostly to find help in other peoples' comments who also struggled or to find a different team/strategy: I don't think many people wanna read about stuff that already happened to them, they mostly want to see solutions and it's the best way to have them in a well-optimized strategy&team already.