A waiver of subrogation stops the sub's insurer from pursuing the GC to recoup a claim payment. Normally, after paying a loss an insurer can step into the insured's shoes and sue whoever was responsible; the waiver gives that right up in advance.
GCs require waivers, on both general liability and workers' comp, so that resolving a claim does not boomerang back as a recovery action against them. Like other key terms, it must be backed by an endorsement.