Milwaukee and Ryobi are both made by Techtronic Industries. So the quality control is going to be around the same for both because they are subject to the same company culture.
It is true that they both have high quality control, and is one of the differences between either and HF low end products. However after quality control you still have to consider the performance of the materials used. Each tier up in durability and performance raises the cost, component by component.
Milwaukee is often the performance leader, but I've seen enough reviews to be wary of them if I don't need that level of performance to make a living.
The thing is, you buy that performance, and the durability necessary to achieve it without self destructing right away, to achieve longer life running at lower than that high performance level.
You might be able to redline a yugo and hit 75MPH but it won't last doing so. You can do that in a Camry all day long, every day, without being required to ever drive it 120MPH.
DeWalt just feels like the safer buy because the construction folks always seem to default to them and thus they come with superior external durability, like resistance to drops.
Dewalt did seem to have a lead on durability 20 years ago, have superior cordless tools at that point, but then Milwaukee caught up and both started offering prosumer grade tools to compete in that market at lower price points so it depends on which models you're comparing.
Pay $150 for a drill w/battery & charger, and you're not getting contractor grade durability, especially if a chunk of that went into it being brushless which inherently needs a sturdier case because the case is the frame for the motor assembly.
I remember reading long ago somewhere that Metabo is what to get if precision drilling is what someone needs.
It's a pretty penny to spend, when it may not survive a drop either. I'd use a drill press when something needs precision, but none of my drills have perceptible runout so should be precise enough. Drill press takes the user out of the precision equation by having a fixed linear drill motion.
Electric motors themselves are one of the hardest thing to screw up; they basically only die beyond repair when they experience excessive heat to the armature.
Cheap drills may run the motor at its max to eek out barely acceptable RPM or torque specs, use shorter lived brushes and bearings, and worse efficiency which along with slim motor output margin, leads to short runtimes before overheating, which is exaccerbated by the lower output requiring them to run longer to get the same task done.
I've experience two starters and a dead lawnmower that died in that way; I took the time to tear down the devices just to see the failure mode. If someone just needs holes in a 2x4 up to a 1/2 inch wide and time is not of the essence(i.e extra time pulling the drill bit in and out), that's when Harbor Freight because the choice to go to.
Fair enough if you just need a small # of small holes in soft wood, but a drill is useful for so much more than that if it can generate more torque and run longer before overheating, and there is still the factor of # of uses vs cost. If a drill costs 3X as much but lasts 3X as long and is useful for more tasks, it may be a better value to a lot of people.
One factor in drill performance is,
can it keep up with you. It can be aggravating if a tool keeps bogging down and you're getting bored staring at it while it seems to futilely chug away while getting little done. Plus, if the motor RPM is reduced too much, it pulls less air through it and overheats faster.
Some materials lend themselves to drilling at higher RPM, or say you have a wire brush on the drill for derusting parts and it's doing more to generate heat than to remove rust and instead of the brush guiding the amount of pressure used in an intuitive way, you're alternating between putting the brush to the surface and pulling it back because the tool keeps slowing down. Ugh. Granted an angle grinder is often better for that, but a drill with smaller brushes gets into smaller areas, but not so small that a dremel tool makes sense.
My experience with Ryobi comes from two leftovers by two different strangers. A garbage miter saw that can't cut straight, and an electric drill that does what it does: drill holes. The drill is fine, the miter saw needs to be bricked because the cut is not long square.
I would only get a contractor grade miter saw. The more complex the tool, the more important it is that every component be tightest tolerances possible or else the sum of the parts is slop that only gets worse as it ages.
There is still an argument for a low-median grade tool if you hardly ever use it so it takes years for the wear to cause too much slop, but for something like a drill or impact driver, it seems such a basic and useful tool that it is easy to get a lot of use out of it if you're handy at DIY projects or repairs.