I don't think it's that the lawyers are undifferentiated; some are better than others, in the same way some real estate agents are better than others (source: people complaining bitterly about theirs).
The problem is that there's currently no effective way to comparison shop. Needing a real estate agent or lawyer is a rare event for most people, so they don't have grounds to make a comparison. And you can't really tell how good they are until you've hired them.
Compare to, say, an auto mechanic. In the US, 90+% of households own a car, and after a few years of car ownership, unless you're a much luckier person than I am, you've probably been to a few mechanics and had some good and bad experiences. On top of that, most of your friends have done the same, so it's much easier to get enough data to figure out who to take your car to next. And, of course, the stakes are a bit lower: a lot would have to go wrong for you to end up in jail because you picked a bad mechanic, and cars are usually cheaper than houses.
The problem is that there's currently no effective way to comparison shop. Needing a real estate agent or lawyer is a rare event for most people, so they don't have grounds to make a comparison. And you can't really tell how good they are until you've hired them.
Compare to, say, an auto mechanic. In the US, 90+% of households own a car, and after a few years of car ownership, unless you're a much luckier person than I am, you've probably been to a few mechanics and had some good and bad experiences. On top of that, most of your friends have done the same, so it's much easier to get enough data to figure out who to take your car to next. And, of course, the stakes are a bit lower: a lot would have to go wrong for you to end up in jail because you picked a bad mechanic, and cars are usually cheaper than houses.