let's say we start at point A. from point A, we have 2 vectors, one going FROM point A TO point B (direction matters), and one going from point A to point C.
now if we want to know the vector going FROM B to C, we have the following situation:
vector AB = u
vector AC = v
vector AB + vector BC = vector AC (we vector sum by going "head to tail").
u + vector BC = v
vector BC = v - u.
if we want to find vector CB (start from C, go TO B), we have:
vector AC + vector CB = vector AB
v + vector CB = u
vector CB = u - v.
comparing the two, we see vector BC = -vector CB (same vector, but "opposite sign").
in the picture on the left, we want to find the vector from P to Q. this is what we know:
z + PQ = w (both z + PQ and w start at the origin, and end up at Q).
therefore PQ = w - z.
so why does your book say "z -w"?
because if all we want is the DISTANCE, we take |w - z| = |z - w| (sign doesn't matter for distance).