The Intel Core i5-13600K wins in 10 out of 14 comparable specs, with 1 tie. Its biggest advantage is L2 Cache (1233% better).
Core i5-9400F wins in 3 specs (Max Turbo Power: 64% better).
Recommendation
Choose Core i5-13600K if you want the best overall performance — especially l2 cache.
Choose Core i5-9400F if max turbo power matters more to you.