There's a great Milton Friedman test: if license requirements benefit consumers you would expect to see consumers at the statehouse demanding legislation. But this is not what you see in the modern day. It's true very instrumental organizations like the FDA were funded based on public outcry, but now most lobbying done to or affecting those organizations is done by people already in the market.
You must not have never interacted with something like, say, AC install. It's regulated and you're not supposed to buy the parts yourself. You can, but some stores shut you out, they won't take your refrigerant back that legally needs to be disposed of, and so on. Recently I fixed some AC units that just needed a soldering touch up where "real repair companies" wanted to do a full new $10k install.
Similar stuff for locksmithing.