The Intel Core i9-14900KS wins in 9 out of 16 comparable specs, with 4 ties. Its biggest advantage is E-Cores (300% better).
Core i5-13400F wins in 3 specs (MSRP: 72% better).
Recommendation
Choose Core i9-14900KS if you want the best overall performance — especially e-cores.
Choose Core i5-13400F if msrp matters more to you.