The mechanism works the way you describe. Exposure is limited by the repayment source being lined up, and "lined up" only means anything if the escrow officer confirms the end buyer's funds are in the account and disbursable before your money moves. Proof of funds, a commitment letter, a buyer's word, none of those are the control. Sequencing is.
When it fails, your position is a note from the wholesaler plus a recorded lien on the A-B deed, assuming the lien was actually recorded and the leg was insurable. Recovery from there means foreclosure or a negotiated deed in lieu, and foreclosure timeline and cost run from a couple of months and a few thousand dollars in nonjudicial states to a year and much more in judicial ones. Add taxes, insurance, and whatever the property needs while you hold it. One of those can consume the fees from ten or fifteen clean deals, which is the arithmetic that answers your question. If your fee is a service charge unrelated to the collateral, you're relying on the failure rate staying near zero.
So the fee gets sized off the A-B price as a fraction of defensible as-is value, the same test you'd apply to a twelve month loan, and the flat fee sits on top as compensation for the speed. Funders who won't quote until they've seen the address and a value opinion are doing that; funders who quote off a rate card in ten seconds are not.
The other exposure people underweight is title. A defect surfacing after you've advanced puts you behind something you never underwrote, and remedies vary by state, so confirm insurability of the A-B leg and get your lien position in writing from the title company before funding.