On the surface, real estate transactions are quite mundane. You find a property you like, you get a lawyer to do a background check on the ownership documents and draft up the contract, after which you sign the papers and do the money transfer. There's some risk of fraud/land ownership problems for which a lawyer could be useful, but otherwise it's a straightforward business transaction.
However it seems that in the US there is a convention of using buyer and seller agents, which don't seem to do all that much but make each transaction 3 to 10 percent more expensive. What is the reason behind this? Why not shop for houses via something like FB marketplace and only pay a relatively small fee to a lawyer who ensures fraud won't take place?