Basically, if you take a Ryzen Mobile 4000 series CPU, replace the Zen 2 cores by Zen 3 cores, and double the L3 cache, you get the Ryzen Mobile 5000 series. There are a few other changes, but most of the rest of the chip is the same as the previous generation. It's even pin-compatible, to allow laptop vendors to swap in the new parts without changing anything else in the design of their laptop, which should help to bring more laptops to market quickly.
The new parts append either an H or a U to the number (and sometimes another letter, for HS or HX). The nomenclature is mostly borrowed from Intel's laptop CPUs. The H ending means that the chip is allowed to use at least 35 W, while the U caps it at 15 W, at least other than short-term turbo. Higher wattages mean higher clock speeds, and hence higher performance. They also mean more heat, larger coolers, and a thicker and heavier laptop. Thus, while there are trade-offs to be had, you generally want an H series part of it's for gaming, unless you're planning on gaming on the battery.
However, AMD still has some of the older chips with Zen 2 CPUs, and with the CPU shortage as it is, they want to sell those older parts and not throw them in the garbage. (Yes, yes, they'd still want to sell the old parts if there were no shortage, but this gives them a better excuse to do what they did.) Meanwhile, laptop vendors who want to keep selling old parts don't want to make it obvious that they're selling old parts. So AMD decided to rebrand the old parts into the 5000 series. The Ryzen Mobile 5300U, 5500U, and 5700U are all old parts, and while technically new bins as the clock speeds are slightly increased as compared to the 4350U, 4500U, and 4800U, they're fundamentally old parts.
All of the old parts end with U and not H, and you can also distinguish them because the old parts have an odd second digit and the new ones an even second digit. If you dig into the specs, you can also distinguish them by cache sizes, as the new parts have a 16 MB L3 cache, while the old only had 8 MB. AMD adds the L2 and L3 cache sizes together in their quoted specs, but the L3 cache is much larger than the L2, so it's very easy to see if the total is more or less than 16 MB.
Naturally, you want the new parts and not the old--unless the old are at enough of a discount to make it worth your while. If you're buying a laptop, you should be aware that, for example, the 5600U is a faster CPU than the 5700U unless you can push eight CPU cores, simply because Zen 3 CPU cores are a lot faster than Zen 2 cores.