As noted, it isn’t just about system strength. Channels are very important.
For sure, there is the hardware and software parts of the equation. As someone who retired from that industry, I know a “little” about it. :D
Any way, I bought a Google device “one” time. The issue is the updates are really buggy and they bail on updates really soon with Samsung devices supported longer.. On the other hand, Samsung updates are a lot more tested. Pick your poison. For me, I’d prefer to keep a Samsung device for years instead of aging out a Google device. Sure, I was able to install a different OS on it, but I felt it ridiculous considering Google charged a premium price for a non-premium device.
Most of the security issues with Android devices are either Chrome related or app related. You’ll pick up those updates “assuming yoru device is supported by the app” with whatever android device you have. The popularity of Samsung flagships means your devices will be supported longer.
There’s a reason why Samsung dominates the Android market and Google is a minor player, and it isn’t just marketing. Over time, people realize that when you want the very best, you buy Samsung. Similar to Apple, you can be assured that the flagship phones are very, very good.