The policy will pay out the death benefit which will be more then the loan amount outstanding. The payout will be used to pay off the loan first. The remaining cash will be paid to the beneficiary of the policy.