The Intel Core i7-10700K wins in 7 out of 14 comparable specs, with 4 ties. Its biggest advantage is Threads (167% better).
Core i5-9400F wins in 3 specs (Max Turbo Power: 72% better).
Recommendation
Choose Core i7-10700K if you want the best overall performance — especially threads.
Choose Core i5-9400F if max turbo power matters more to you.