Subrogation lets an insurer recover what it paid by stepping into the insured's legal rights and pursuing whoever was at fault. On a project, that can mean a sub's insurer paying a loss and then coming after the GC.
Understanding subrogation explains why a waiver of subrogation is such a common contract requirement, it shuts down that recovery action before it can start.