There are several different types of Real Estate Agent,which most first time home buyers (and often many others!) are not aware of and most agents perform as both types.
The Listing Agent is the agent who represents the Seller of the home.This agent works with the seller to determine market value of a home and then places the home for sale.This agent will list the home on the Multiple Listing Service,which is basically a search engine for Realtors which gives them all the information.
Buying Agents work with folks who want to buy a home.Buyer Agents show homes to prospective buyers,and when a home is found to the buyers liking,a contract is drawn up,submitted to the Listing Agent who then discusses this with the sellers,and often both sides will negotiate until a suitable offer is agreed upon.
Both agents work on commission from the sale of the house,paid by the seller and split between them,
Buyers do not pay their agents...common misunderstanding!