Subrogation is when an insurer pays the insured for a loss caused by a third party. The subrogation clause allows the insurer to recover its claims payment from the party that caused the loss.
The permission to waive subrogation in favor of the mortgage holder prior to loss is a waiver that prohibits the insurer from seeking restitution from a third party who causes any kind of loss to the insured.