Clock-speed, cores, and generation of CPU are all factors:
If you're comparing an i5 8600k (six cores @ 4300MHz - six processing threads) vs. an i7 4700k (4 cores at 3900MHz - eight processing threads) , the i5 would be slightly faster for most applications.