What Apple advertise really doesn't help matters here. 'core i5 and core i7' are the primary upsell for their upgrade trees, but they also charge more for higher clocked versions of (particularly the i7) so that's probably the only reason they even note that any more. They could do with revisiting this, the core counts and threads are relevant (though not overwhelmingly so to most people) inumber is branding more than anything, though does tend to roughly denote a hierarchy within a specific generation of a specific type of chip (but obviously for that to mean anything you have to be at least vaguely familiar with Intel's arcane product strategy). For example you can have a core i7-7820HQ in the surface studio - which will be marketed as 'intel core i7'. Only, its a 7th generation laptop chip that is no more powerful than the i3-8100 in the 4K iMac, let alone the i5 version (these are proper desktop chips) confusing, right? It's partly intel's fault too for having a nonsensical naming scheme, hopefully Apple will come up with something saner if they start making their own ARM mac chips.
I guess the basics you need to know are:
Proper desktop chip? (check for all iMacs)
Latest generation? (yes, 8th and 9th gen insofar as they are available)
i7>i5>i3? (Yes, they are within the same product family*)
*though some are 9th gen and some 8th, doesn't really matter here, but yeah. Confusing again.
Newer CPU's are always better the the ones they replaced. Just not by anything groundbreaking thanks to Intel's laziness.
I guess you just kind of have to trust in this logic (though not always the case as with the mac mini moving to dual core laptop chips for the previous generation).