The lender calculates this number after determining if it will make money by lending to you. The entity receiving the loan pays the cost of debt capital.