I think it's more the bike. But the rider skills are definitely very important.
The best riders in the world can only take what the bike has to offer. The best riders can dial in to any bike but they cannot go beyond the physical limitations of the bike. This is true not only for bikes but cars, trucks, etc.
If the bike is great but the rider can't "connect" with it, he will not take all it has to offer. If the bike is a dog but the rider is great, he will not be able to achieve the same results as with a "perfect" bike.
Some examples to help me sustain my thoughts:
Michael Schumacher is one of the greatest F1 drivers of all time. He won all those world tittles because he was given the best car in the lot. I still remember him driving that crummy Ferrari in the early years and not being able to cope with Williams and Mclaren. This was after having won that F1 title with Benetton-FORD. When the Ferrari was dialed in properly, he had no match. The car was so good that he even won a GP driving his team mate's car just to prove there were no differences between the 2 .
Juha Salminen is the GOAT of Enduro riding. He has titles in Europe, US, 6 days, etc. (Not wanting to start a fight but I simply like his fluid riding style

) He spent 3 miserable years riding that dog of a BMW that was suited for everything else but Enduro. The minute he moved to Husqvarna he was champion again.
Last but not least, the Yamaha 450f...Stewart tried it, FIM champion David Philipaerts tried it, Davi Millsaps tried it... he had a great SX season after he moved to Suzuki, I don't think it's a coincidence .
The best riders are always fast with any bike but that does not mean they will win with any.