There's a lot of confusion behind the number of pixels in a camera's sensor and what's right for the buyer. I'd like to explain it in terms of some pretty simple math so you realize that the number is not as big of an issue as it is often made out to be.
Consider a sensor that is 4 pixels long by 2 pixels high. It will have a pixel count of 8 since you just multiply the 4 by the 2. Quite small and totally useless for photography but it makes math easy to follow. If we double the number of pixels such that we end up with 16, it seems that we've made the sensor twice as large. But have we? It will really only give us dimensions of 5.6 x 2.8. Not much of an increase at all. Ignore that we can't have fractions of pixels but what's going on is that the total number of pixels is the product of the length and width. Doubling the number of pixels does not double both of the dimensions. It only doubles one. You would have to quadruple the number of pixels in order to get a doubling of both dimensions. The factor is based on the square root of 2, much like much of photography. The 5.6 and the 2.8 should sound familiar if you've played around with cameras long enough.
So, for the Canon R5 that has 45 MP and its little brother, the R6 which only has 20, it seems that the R5 has a much higher resolution. But when you look at the math, in any one dimension, there is only an increase of 41%! That's a considerable difference but it's nothing like twice the difference which is what the pixel count implies.
So, if you don't normally do heavy cropping of your images, you will likely find that the lower pixel count bodies are perfectly fine for most of what you shoot. On the other hand, if you are always craving that extra focal length and can't afford the bigger lenses, then a little extra pixel resolution may be what you need.
Tri-colored heron captured with an 18MP camera body
Personally, I rarely crop much if at all. I have long focal length lenses and I am able to position myself in order to get close to my subjects most of the time. So I don't need the few extra pixels that the higher resolution sensors provide. Sure, more is better if you can get it but more pixels almost always comes at a cost of either money or the introduction of noise and usually both. For me, I prefer the better dynamic range and low noise performance that are usually seen in the lower resolution sensors.
Each photographer will have to weigh their own needs and priorities but just realize that the discussion over the number of pixels is hardly worth debating. The professional cameras over the past 10 years have never had more than about 18 or 20 MP and they all put out beautiful images just like the one pictured here.