it's all important. you need as many cores/threads as the game requires. plus whatever extra for streaming and whatever else is running. too few cores/threads and something as to suffer from a core pulling double duty. too may and resources sit there unused.
once you have that covered, you have to look at how much work the core can do in a single cycle. known as
IPC or instructions per clock. speed is not the only thing to consider. 5 ghz with an IPC of 100 would do less work than a 2 ghz core with an IPC of 1,000 !! (note that there is no such number attached to IPC, just an illustration for the point.)
2 cpu's with identical IPC would now look at speed as the faster one would do more cycles per second and thus more work (again note that 2 cpu's NEVER have the same IPC, it will be similar within a single gen of a single brand ie 13500k 13600k 13700k... but never identical. between brands you won't even get close to the same IPC). this is why reviewers will lock a cpu to say 4 ghz and run it next to another also at 4 ghz. same speed means same number of cycles per second. the one that does more work has a higher IPC.
once IPC is considered the xtra cache and such can now come into play as it can help feed a core better so it can do all that work easier.
as you can see its all important but in a sort of order. in the end though, you won't notice the difference between a 13600k or a 7600x if both have enough cores/threads to do what you need done. in general the more you want to do at one time, the more cores/threads you need.
keep in mind that intel's P-core and e-core thing are not the same cores. the p-cores are current gen strong cores and the e-cores are older tech thrown in to increase the count. might be enough to do the job, might not be depending on software needs. AMD on the other hand are all full current cores across the board.