While that's true in general, once software becomes old enough it enters a sort of legal gray area. That's the same reason why even big organizations like archive.org can offer free copies of old obsolete software
https://archive.org/details/software
It's not a gray area at all - software falls under copyright law, and in the US, copyrights for anything written recent enough to be software is essentially guaranteed to stay protected under copyright until everyone reading this forum today is dead.
The original author (or author company) retains all rights to the distribution of their software. The vast majority of software is licensed - meaning you must agree to certain terms to be permitted to use it. Those licenses are legally binding in the US. There is no such legal definition of "abandonware". Just as with books, if software goes "out of print," the original author still retains the copyright, and if that author doesn't make it available via some allowed means (or the author "vanishes" and no permission gan be gotten,) then the only legal way to get it is to purchase a legally-allowed previously-published copy.
Just because a book is no longer printed by a publisher, and the author is dead, doesn't mean anyone can just photocopy and give away that book.
Archive.org gets permission for all media it hosts. Audio, video, text, and software. Many authors of software that is obsolete have willingly granted "free license" for the use of it. But many haven't - especially "large commercial" program (such as Mac OS 9.) In many cases, it is because the large commercial programs use pieces licensed from other companies, and getting permission from *THEM* is near-impossible.
Lastly, just because something is firmly prohibited by law doesn't always guarantee it will be pursued. Many companies turn a blind eye to piracy of obsolete versions of their software, just as some law enforcement agencies turn a blind eye to enforcing certain laws (jaywalking is a commonly unenforced law.) It doesn't make the behavior legal, it just means it goes unenforced. That is why Macintosh Garden is generally allowed - if an author complains, Macintosh Garden removes their software.
Again,
There is no such legal definition of "abandonware". Just as there is no such thing as "legal illicit drugs". There is just "unenforced violations." It doesn't matter that Apple hasn't sold Mac OS 9 in 12 years. Unlike patents, there is no short-time expiration beyond which it's legal to duplicate. With software, covered under copyright, the SHORTEST time something would fall into the Public Domain is 70 years (assuming it was self-published by the author, and the author died immediately after publication, as individually-authored works retain copyright for the life of the author plus 70 years.) "Works for hire" (as most products by large companies are,) are 95 to 120 years.
Note that these times are for any copyrightable work created in 1978 or later - covering nearly all software we might possibly be discussing. For works created in 1978 or later, copyright is automatic upon creation, and falls under the 70-120 year copyright range.