The sodium salts of chain polyphosphates are able to complex with calcium and magnesium ions thus preventing them from forming a scum with soap.
Ca2+(aq) + P3O105-(aq)CaP3O103-(aq)