I have arrived at this conclusion for several reasons:
I work at guitar workshop where we go through roughly around 1000 guitars every year. We also have a close collaboration with a dealer who sell both Fender and Yamaha instruments, and we often do warranty repairs for them. The quality of Yamaha guitars and basses is generally very good. Their top models are superb. The quality of Fenders can also be very good, but they are very inconsistent. To be fair, things seem to have been moving slowly in the right direction over the last couple of years. The absolute low point was during the introduction of the AmPro and Original series. The quality of MIA Fenders really took a nose dive during that period. Some of the brand new MIA Fenders I've seen over that last decade or so have quite frankly been shockingly poor when considering the prices they charge for their instruments.
Every single Yamaha manufacturing site, whether it is in Japan, China or Indonesia is ISO certified. Yamaha take quality control very seriously, and when something isn't right they treat dealers with respect, stand by their products and sort it out. Fender... not so much. They are a nightmare to deal with and the dealer is very often stuck with the cost of warranty repairs or fixing faulty, brand new instruments.
I also own around 10 Fenders, at least as many Squiers and a couple of Yamahas in various price ranges (guitars and basses), but this sample size is obviously much smaller than the number of guitars I go through at the workshop.
Based on this experience my conclusion is that Yamaha offer objectively better, and more consistent instruments than Fender/Squier in any given price range.