OSX was used originally to just describe version 10, a big change to the OS which broke backwards compatibility. Now its used loosely to describe any version above 9.
Each point version of OSX has a codename, Yosemite is v10.10. The latest version 10.14.x has the name Mojave.
Apple recently rebranded OSX to macOS, possibly to have a version number higher than 10 some day.