It should probably be easier to understand if you see it this way instead:
char c1 = *p1;
char c2 = *p2;
c1 = c1 ^ c2;
*p1 = c1;
That's basically what the code you show is doing.
This of course relies on you knowing how exclusive or actually works, and know about pointer dereferencing too.