mooreds answer is spot on. I'd add that experienced agents also know how to spot potential issues when touring houses, what work you should and shouldn't do to prepare your house for sale, and can provide a network of providers to help you close your purchase/sale (lenders, contractors, landscapers, etc.).
I thought I'd also mention the company I work for, HomeLight (www.homelight.com). We're trying to provide transparency into real estate agent performance to help people select agents that will actually provide value to them during a property purchase or sale.
There are over 2 million licensed real estate agents in the US. The average number of transactions per agent per year is under 2. Good agents can provide tremendous value, but finding those gems is really tough, especially when agents, until recently, tried very hard to hide their past performance. Also, a lot of markets don't really require a lot of work from agents. In SF for instance, you can list almost any property and get above asking price for it after one weekend of open houses, but that doesn't hold for other markets, which can make the 5%-7% commission feel like you're being cheated.
When my wife and I were looking for houses in the East Bay (Oakland and Berkeley mostly) our agent was average. She would send us property dumps for the entire city of oakland (we had no interest in east oakland, but she kept sending us properties there) and she didn't respect the way I wanted to communicate with her (email...she called me all the time), and she didn't provide great guidance on what we should offer on properties we were interested in. But, she did a good job showing us properties and pointing out issues, figuring out all the open house times, communicating with other agents, introducing us to a great loan officer, etc. I /could/ have contacted all the listing agents for the 10 properties we wanted to see a week myself, but she did that for us, which saved a ton of time.
Agents that are "bad" are ones that won't return your calls, don't listen to your needs, try to show you properties you aren't interested in, don't know the area you are interested in well, can't identify when a roof probably needs to be replaced or if someone just painted over the black mold in the basement corner, hooks you up with crappy loan officers, etc. And unfortunately, there's a TON of those agents out there.