It does what its name says: it swaps the ith and jth elements.
It is an assignment, more specifically a tuple assignment:
p[i], p[j] = p[j], p[i]
It assigns values to
p[j], and the values that are assigned to them in order are
The assignment proceeds in two phases. First, the operands of index expressions and pointer indirections (including implicit pointer indirections in selectors) on the left and the expressions on the right are all evaluated in the usual order. Second, the assignments are carried out in left-to-right order.