Hit or miss. many have made an effort in the last couple years to get better. Samsung was notorious for devices earlier than the S5 getting about a year worth of "sparatic" updates. By the time of the S6, they had a bit of an "awakening". They stopped with the plastic. and promised that they'd support their devices for two product generations after. (S6 would get updates until the S9).At least it's getting something. I've heard that's not the case for many Android phones.
The updates are still somewhat inconsistent in the timing of delivery. I'm not on a carrier branded phone so this is even coming directly from Samsung. But compared to any OS, security updates aren't released on a regular schedule. Although I had been getting them around once a month.
If being on the latest OS version with the latest "coolness", than iOS or a Pixel running stock android is really the only choices. If you're not particularly picky about the latest Anrdoid version itself, then the playing field opens up to a few dozen manufacturers, all with their own policy and routines for delivery. It's always recommended that if you're an update fanatic (I used to be), than it's better to investigate before buying what sort of update history that manufacturer has.
This is of course, because we're us talking about this. I'm pretty confident the average consumer doesn't really give a crap about the OS version on their phone. they just care that it works, and that they don't run into limitations trying to run the apps fo their choice. This is where however iOS and Android truly seperate in how they do things.
iOS updates are incredibly important because iOS updates are both security and feature updates bundled in one release, including major applications that are baked into the core of the platform. Many iOS apps cannot be updated independantly of the OS such as Safari.
Google has done this differently, where Google's service platform is not baked into Android itself, but run as apps on top. This allows Google to update every single application independently of the OS. Android can deliver it's core apps and services on devices that run older OS's so many users new modern apps and old legacy apps generally still run, even on older devices who don't get Android updates.