The compensation that a buyer’s agent (also called the “selling agent”) receives typically comes from the seller’s proceeds and is a percentage of the total commission charged by the listing company. That information is available to me through the Multiple Listing Service (MLS). In such a case, there is no cost for a buyer to be represented by an agent.
If a buyer is interested in purchasing a property not listed in an MLS, it is possible that the seller will not compensate the buyer’s agent. In this case, a buyer agency agreement would detail the buyer’s obligation to compensate their agent. Typically, even with unlisted properties, the seller compensates the buyer’s agent.