How Does My Real Estate Buyer Agent Get PAID????

Ok i know that the seller/ buyer agent will split 5% but who pays the agents me as the buyer or the seller and where does the funds come from in order for them to get paid? can someone please help me understand… due to this being my first deal and purchase???

The agents are paid out of the proceeds paid to the seller in escrow. The seller effectively pays the agents out of the proceeds he receives from his buyer.

Sometimes however, the seller doesn’t receive enough money to pay the agents, and has to come out of pocket to complete the closing.

Thank you for the feedback