In a typical GTA resale transaction the seller pays the commission for both sides out of the sale proceeds. A buyer usually writes no cheque for representation. But "usually" is doing some work in that sentence, and it's worth knowing where it doesn't hold.
The normal arrangement
A seller agrees a total commission with their listing brokerage (5% is the common figure in this market, usually 2.5% to each side), which is then split between the listing brokerage and the co-operating brokerage that brings the buyer. Both halves come out of the seller's proceeds on closing.
Some listings offer a reduced co-operating commission, or none at all, which is more common with private sales and discount-brokerage listings. If the amount offered doesn't cover the work, your representation agreement is where any shortfall would be addressed. You'd hear about it from me before we wrote an offer, not on closing day.
Under the current rules, your representation agreement must set out any amount you could be responsible for. If that figure is blank or zero, you owe nothing. Read that section before you sign; it exists precisely so this conversation happens up front.
What it's paying for
Access to comparable sale data rather than asking prices, someone who has been inside the competing listings, offer strategy on a competing-offer night, and a set of conditions written to protect you rather than to look attractive to a seller.