In some jurisdictions, they cannot be "public domain", unless their authors
died at least 70 years ago, which I very much doubt. They are probably
distributed under a so-called "permissive license" (aka "lax license", aka
"pushover license"), which lets anyone do anything they want with the work.
Including changing its license for a proprietary software license.
The other category of free software licenses are copylefted licenses, such as
the GNU GPL. Using a copylefted license, your work cannot end up in
proprietary software. It is the whole point of the copyleft: preventing the
middleman from stripping out the freedoms you want to give to whoever uses
your work, modified or not. See https://www.gnu.org/copyleft/
Now, if the programs you are referring to do not bear any license, they are
"all rights reserves", hence proprietary, under the Berne convention. See
https://www.infoworld.com/article/2615869/open-source-software/github-needs-to-take-open-source-seriously.html
for instance. Here is an excerpt:
You don't have to include a copyright statement for your creative work to be
under copyright. In any country that's a signatory to the Berne Convention,
copyright -- or stronger -- is the default as soon as something is created.
If you completely ignore the subject, all your work is copyrighted to you (or
to your employer in many cases), and anyone who copies it to use or improve
it is in breach of your copyright.
See https://www.gnu.org/licenses/license-list.html for a long list of
licenses. For free software licenses, the description usually tells whether
the license is permissive or copylefted. About "Public Domain", that page
says:
If you want to release your work to the public domain, we encourage you to
use formal tools to do so. We ask people who make small contributions to GNU
to sign a disclaimer form; that's one solution. If you're working on a
project that doesn't have formal contribution policies like that, CC0 is a
good tool that anyone can use. It formally dedicates your work to the public
domain, and provides a fallback license for cases where that is not legally
possible.
And about CC0:
CC0 is a public domain dedication from Creative Commons. A work released
under CC0 is dedicated to the public domain to the fullest extent permitted
by law. If that is not possible for any reason, CC0 also provides a lax,
permissive license as a fallback.