...
But looking at the resources and knowledge that companies like JBL, Revel, Focal and many others have and use to design their products I wonder if the quality of a diy loudspeaker can even come close to the quality that these companies deliver with their products?
Bottom line up front: Yes.
But I understand your skepticism. When I was in college I was broke, but I was obsessed with speakers. My research into speaker design and psychoacoustics started as a way to ensure I could get the best value for my money. I wasn't planning on building my own. But by the time I had scraped up enough money to buy speakers, I felt like I knew enough to design and build my own. Between studying electrical engineering and reading the madisound board, I was fairly well prepared. I built a pair in my father's basement, and I was very surprised at how good the result sounded. Quality parts in an over-built box, and a bit of luck on my side created a result that couldn't have been matched commercially for the money invested (perhaps on the used market it could have been).
But after graduating and starting my career, things changed. I left the DIY speaker hobby for a few reasons: I already had a nice set of speakers, I had money to buy commercial speakers if I was inclined, and my time became more valuable.
What brought me back into DIY was a design idea that was different from commercial offerings. I may have money, but I can't buy something no one is selling. So I designed and built a set of multi-way, on-wall, passive CBT line arrays. I made novel efforts to address early reflections and diffraction, and committed to building a set of speakers following the science as I understood it, with no real way of predicting the result. It turned out to be the best speaker I had heard up to that point. I applied some reasoning similar to yours about research and budgets at large speaker companies, and got pretty excited at the prospect of hearing a far superior speaker, even if that speaker would cost many tens of thousands of dollars. Unfortunately, that search hasn't panned out. I've been to a couple audio shows, and made a point to listen to every single room. Unfortunately, I still haven't found a speaker that's even as good as what I built at home, let alone "far superior".
So now I'm back in the hobby, but with a different approach: I only build things that are substantially different from commercial offerings. My designs are more experimental. I'm really not interested in designing anything conventional, because that's a crowded space filled with lots of offerings with economies of scale on their side (and I consider the value of my time for projects now, which I didn't care much about in my youth). I have been able to accumulate some interesting perspectives based on this approach, though I can't say I have much of an audience for my ideas.
Here's a pic of the next concept I'm considering testing: a shallow on-wall wedge. The idea here is that the speaker box blends into the wall acoustically, approaching an infinite baffle, increasing coherence and efficiency. Since it can't be toed in, I'm picturing a small, wide dispersion tweeter and mid, necessitating a 3-way design. I have yet to pull the trigger on making this, partly because I just don't need another pair of speakers.