JR Raphael is a good authority on this:
https://www.computerworld.com/article/3530002/android-10-upgrade-report-card.html. There are a lot of different facets to this, so it's hard touch on everything briefly. Some key points that I think are important:
1. Google's own Pixel phones are the best in terms of updates, which as hallux mentioned includes both major system upgrades and monthly security patches.
2. OnePlus and Nokia are next best (Nokia due to the fact that all of its phones are Android One devices, which means they're essentially "stock" Android without any additional bells and whistles tacked on that often require more work to update).
3. Samsung's pretty good, as long as you have one of their flagships (although they do a pretty good job with their midrangers as well). JR gives them a D+, but I'd give them a bit of a pass considering the sheer volume of phone models and variants they have, as well as the large amount of skinning (One UI) and extra features/bloat they put on their phones.
4. All other major manufacturers are not worth considering if updates are important to you.
5. System updates and security patches pushed over-the-air are not the end of the story, though. Over the years, Google has been adding channels to update components of the phone separate from those system updates. For example,
Google Play Service updates (which continue well beyond a device's end of support life) can provide added features as well as certain security enhancements, and a number of Google system apps can now be updated directly through the Play Store (instead of having to wait for a system update). Also,
Project Treble is another way Google has been trying to separate out certain system components that can be updated more easily.