Real estate agents are generally paid by the seller for a house sale, and by the landlord for a rental situation. Landlords go to agents to use their services to list the property, find new tenants, and in some cases even manage the property afterwards.
In my area, both the landlord's agent (who lists the property) and the tenant's agent (who shows properties to tenants) get $400 each when a lease is signed. Generally the listing agent submits the property to the big listing services, and the showing agents search those services to find properties to show their clients.
Agents who list properties will often also post them to general search sites and Craigslist. This way, more prospective tenants can see the property, including those who are searching without an agent. If the listing agent closes a deal with a self-representing tenant, sometimes they get to keep the entire $800.
This knowledge is important to have when you are looking for a place. Your agent will only show you properties listed by other agents, not properties listed by the owner, because then they'd get no commission. So you may want to look on Craigslist etc. But do this before consulting your agent; it would be rude to have an agent show you some places, and then close a deal without them so they do not get paid for their work.
Either way has pros and cons: agents can help you find properties, will know the area and the process well, and can be a resource. But sometimes agents can add barriers or complications to negotiations with the owner/landlord.