Which of these two processors are better all around?

12th Gen Intel® Core™ i7-1255U (12 MB cache, 10 cores, 12 threads, up to 4.70 GHz Turbo)

or

13th Gen Intel® Core™ i5-1335U (12 MB cache, 10 cores, 12 threads, up to 4.60 GHz Turbo)

I did some research and found when the two are compared, the 13th gen i5 scores higher. When one comparable processor is one generation higher than the other, do the i5 or i7 labels (for example) not compare as well as if they’re from the same generation? Is it just entirely about the specs of the processor and that’s it? Would a 13th gen i3 be better than an i7 model released 10 years ago? Is generation more important than the i3/5/7/9 label? Trying to better gauge how this works.