The two structures.
In a lender-paid arrangement, the wholesale lender compensates the brokerage. The borrower does not write a separate check for it, but it is not free — it is reflected in the loan's pricing.
In a borrower-paid arrangement, the compensation appears directly in the borrower's closing costs. Federal rules prohibit a broker from being paid by both the lender and the borrower on the same transaction.