Apple stopped charging for macOS updates with Mac OS X 10.9 Mavericks. Strangely, Apple still sells Lion and Mountain Lion for $19.99 each. To get Lion and Mountain Lion for free, you can visit the support documents for those OSes on Apple’s website:
But there’s good news: Apple is now offering Lion and Mountain Lion for free for anyone who wants them. Some people are still using OS X 10.7 Lion and OS X 10.8 Mountain Lion, and until recently, you had to pay Apple $19.99 to get download codes for those OSes. While macOS is currently on version 11 (otherwise known as Big Sur) and macOS 12 Monterey is coming later this year, there are plenty of folks who use old versions of the Mac operating system.