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.
Learned this today: posted a comment, came back later to see if there was any feedback, reloaded the page: the page posted a copy of my comment. That was not what I wanted. I just wanted to check if my comment was posted and if there were some responses. I did not want to post a copy of my comment from 5 hours ago. And, a humble guess, I think the majority of the users are not expecting such behavior either.