Is an i7-12700 even better than an i5-12600k?
Intel Core i3/i5/i7/i9 CPU differences
I need help understanding the difference between i3, i5 and i7...
How Do You Compare Across Processor Generations And Brand Modifiers?
Videos
Here is a chart https://i.imgur.com/hgUYJau.png showing the differences across generations 1-12, slightly simplified
In general i7 will have more cache, MHz, and cores/threads than i5 and that in turn i3.
The 1st-7th gen i7s had 4C, 8T, which is the same as a 10th gen i3. There were IPC gains from gen 1 to 2, gen 3 to 4, and 5 to 6. Gen 10 to 11 achieved higher IPC, but with simultaneous power increase. Gen 12 achieved huge efficiency gains. A gen 11 chip is very close to gen 12 with the same cores and clock speed, providing the default power settings are overriden.
There tends to be an increase in cache every two generations, and clock speed boosts each gen. A 10% clock speed boost will give about 5% overall CPU performance gain.
The double threads of old i7s gave them very good longevity.
That no longer applies in that you can choose between 8 (i3), 12 (i5), 16 (i5-12600K), 20 (i7), or 24 (i9) threads. Technically the i7 is still likely to last for longest in that it has more threads, cache, and the non-K version comes with a cooler.
The relationship does change across time, and also varies a lot on laptops. E.g., in the past Pentium = almost i3, but currently that is not the case.