To be specific, the way Safari is updated is by upgrading your computer's software. An upgrade is when you install a newer OS version, such as upgrading from Catalina to Big Sur. An update is to install a newer version of the same operating system. The reason for this is because Safari is installed as part of the operating system. It cannot normally be individually installed. Incidentally, a newer version of Safari does not always work with every web site, which then sends you those messages. Sometimes it is necessary to install another browser such as Firefox or one of the many browsers available from the Apple App Store to use with certain web sites. They are individually installed and upgraded.
Incidentally, iOS is the operating system for iPhones and iPads. Macs run on Mac OS. They are completely different operating systems.
So, the latest Safari version is installed when you upgrade the OS on your iMac. You can check the model year of your iMac under the Apple menu > About This Mac.