Earlier quoted context omitted.
I went to the wikipedia page, which is kinda the point. No other OS requires you too look it up. Even WatchOS and iOS directly use version numbers. Saying it's due to NextStep integration sounds like a strange defense of this naming strategy (if that was your intention). They have version numbers, but they decide to use the "code name" as a product name.
MacOS versions have a number, which counts up, the same as iOS and WatchOS. "Sonoma" is a cutesy name for "MacOS 14", the same way that "Jammy Jellyfish" is the cutesy name for Ubuntu 22.04. The version number is shown in the About This Mac page, which is the top menu item in the Apple menu at all times.
Off the top of my head I couldn't tell which was later out of Big Sur, Ventura, Monterey ...