Exclusives do matter a lot, but they're not everything. Wii U had many failures: It was expensive for what it was, had a complex selling point that even Nintendo struggled to showcase, poor marketing and name, and so on. Not to mention most of Wii U's exclusives lacked ambition or weren't what people expected. It never had an exclusive Zelda, it never had a Metroid game, it had the worst 3D Mario, the same old "New" 2D Mario as a main system seller during its first year, a 2.5D DK when people expected a 3D one at that point, Smash released first on 3DS which disrupted its sales potential on Wii U, and so on. The highlight of the system was Mario Kart 8, which was an ambitous game (it had great graphics, a new gameplay concept, amazing tracks, characters from other series, great DLCs, etc). Coincidentally, it was the best selling game of the system.
Meanwhile, Switch is almost the opposite: Great value for what it is (a hybrid of home console and handheld), an easy to sell concept, great marketing, an easy to get name and ambitious/high quality exclusives.