It doesn't, directly. What matters is what you're doing with them. If you're using programs which parallelize nicely, then multiple cores are much better than clock speed (This is why Graphics cards have 1000+ cores and barely operate at 1GHz or slower). If you have a load which is single threaded (like a lot of games), then clock speed matters a lot more because the extra cores are useless
Think of it like this:
A slower multi-core processor is like a bus, while a faster single-core processor is like a race car. The goal is to get as many people where they need to go as possible.
Let's say you need to get 20 people from point A to B: The bus will win, even though it's slower, simply because it can carry all 20 people at the same time, where as the race car can only move one person at a time, and has to make 20 trips. It's fast, but it's not that fast.
But what if you need to move one person from point A to B? A race car is much faster than a bus, even if the bus is only carrying one person.
The trick is finding out if your applications have one person that need to go really fast, or a bunch of people that need to be moved.
Servers frequently have many processes running and are doing lots of separate jobs: Very often, they find themselves in the "bus moving 20 people" scenario, so it's common for them to have slower CPUs with lots and lots of cores.
Consumer desktops are starting to do more and more in parallel, but relatively speaking compared to servers, a desktop still has one person sitting at it, doing one thing at a time, so it's still worth it to try and push CPUs faster instead of having insane numbers of cores.
That said, it's much, much easier to make a CPU with more cores than it is to make it faster. We've been making them faster for many decades, and while they'll get faster yet, it requires a lot more research for smaller and smaller improvements. Comparatively, we've just recently started really pushing multi-core technology, which means that for very little research, we can add more and more cores. This is why lots of stuff is being rewritten to utilize multithreading and multiple cores.