For vintage products, restoring to factory settings often has to be done through torrents or Github. Other then that no complaints.
If you have older hardware (as old as 2007), you can download Yosemite, El Capitan or Sierra from Apple’s website [1] or the App Store. Note that using those images requires access to a working Mac, or at least a Mac with working (Internet) Recovery, although doing it in Recovery is complicated and requires some tricks [2], because Apple can’t just make a simple DMG you could mount (or image a drive with) and install directly.
[0]: https://9to5mac.com/2011/07/20/what-is-os-x-lion-internet-re...
[1]: https://support.apple.com/en-us/HT211683
[2]: https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-...