Quality-wise, Makita > DeWALT β₯ Milwaukee > Ryobi, at least, if you watch teardowns by guys like AvE.
Power tools are like cars; companies hold several brands and target them to different market segments, like Porsche and VW.
Ryobi is owned by the same company as Milwauki; it's the budget line, Milwauki being their premium line.
DeWALT and Black & Decker are owned by the same company; DeWALT is their premium line.
The exception in this list is Makita, which is its own company. They're also objectively more well-built than the others (here), and correspondingly usually more expensive.
The premium lines are better quality (not just more expensive) but also tend to have smaller battery-tool options. Despite being a budget line, I mostly own B&D because most of my tools these days are 24V and there are more tool options there. The few, select, DeWALT tools I have are noticably better quality.
I don't use power tools enough to justify Makita, but also, their battery-powered line is comparatively tiny. As someone else said, there's a lot of motivation to pick a (compatible) lane, whichever it is. For most home-gamers, the quality difference will probably not matter much. If I were made of money, though, I'd have everything Makita except for the things they don't make.
My tool experience is limited, but with Makita you seem to be describing the same anachronism principle you find in espresso machines.
Arguably the best espresso machines in a class are reminescent of the same model you found 40+ years ago. If you're looking for the B+ range, everything worth buying has a big metal E61 grouphead with manual levers. In the S-class range, you tend to have more manual levers as often as bells or whistles. My new machine that cost more than I deserve (wife bought it) is basically an oldschool machine with nothing modern in it but a PID controller. Legend has it, it will be passed down in my family for generations to come (exaggeration, but not much).
Hmmm. You may be right. I have owned no Makitas. I'm going by tear-down videos. AvE may have gone a bit off the rails, but he's done some really good tear-downs of different tools, and looked at the quality of the materials, the casting, the motors, switches, and so on. He consistently was impressed by Makita's build quality... but all of those videos are, like, 6 years old, or older.
It'd be too bad if even the "good" makers like Makita went the quantity-over-quality commercial route.
It drives me nuts that Milwaukee used to be the best line about 10 years ago. They sold out their good name and started selling shitty tools after I bought into their battery system. Grrr.
I really like DeWALT. I think it's a solid choice, and I doubt anyone who isn't a professional will notice the difference in quality between those and Makita. Plus, they have some neat tools that have unusual features that make an unexpectedly large improvement in ease-of-use.
One of the things that convinced me to go Makita when choosing my "house" was that they don't have separate high and low voltage battery systems. Dewalt, Ryobi, and the others have a 18v/20v system and a 36v/40v system. Makita has bigger tools that you plug two batteries into and by the power of math you have a 36v tool off two of regular batteries.
At least when I was looking that was a unique thing to them and seemed like a great idea.