In many cases, the commission is split evenly between the buyers and sellers agent. That's not always the case, and there are many transactions where the commission is a set dollar amount. In the Southern California area, the average commission is 4.92%, typically at about 2.5% for each agent.
The buyer's agent has a difficult task. Get the home for the client, at the lowest price. They have to be able to negotiate with both parties figuring out the right dollar amount that will get the buyer the home while not overpaying. The difference in commission is minimal at best.
Take for example a home that's going for 400k. Typically commission breakdown is 2.5% of 400k = $10,000. Take 20% off that goes to the broker (average) and $500 for hard costs (many buyers agents end up spending something out of pocket to help close a deal). That leaves them with $7500. Let's say that house sold for $420k. They'd walk with about $7900. We're talking a few hundred bucks for a $20k difference in home price. I'm not even including the cost of actually doing business, taxes and insurance which knocks about 30-40% off that commission.
The buyer's agent isn't trying to squeeze a few hundred bucks of commission by getting a higher price, they're trying to get you into a home or they don't get paid at all. They're also trying to make sure you are happy, and will refer you to others. Something like 75% of a real estate agents business will typically come from referrals and word of mouth.
The real issue, is when you use the same person for buying and selling. Dual agency is legal in many places, but it's an ethical gray area for sure. You are basically negotiating with yourself and have all the information.