Its simply two separate transactions that use the same money.
Wholesaler B makes a contract to purchase the property from seller A. B then makes a contract with end buyer C to sell the property. Take both contracts to a friendly title company. End buyer C wires in their money. The title company uses that money to fund both the B to C sale and the A to B sale. They do two set of paper work, including two deeds. They record the A to B deed first and the B to C deed second.
Now, there are numerous things that can go wrong. The end buyer C needs cash, hard money or a lender who's understanding about the transaction. If they are using a conventional lender, that lender will look at the title before they find the transaction, and may will refuse to fund it when they see the seller doesn't own it.
Some lenders want seasoning on the ownership. Because B owns it for a matter of minutes, the won't fund C's purchase. FHA, in particular, requires 90 days ownership by the seller.
Some title companies won't do this sort of transaction.
One way to make it work in more case is "flash cash". B borrows the money to make the purchase from A for a very short time. So, one batch of money comes from C or C's lender and a second batch of money comes from the flash cash funder. The flash cash is used by B to buy the property from A. C's money is used to buy the property from B. B then repays the flash cash loan with the money from the second transaction.