A work that is in the “public domain” can be freely used by anyone. However, a work (which is copyrighted by default upon creation and fixation) only enters the public domain if its copyright protection has expired, or if the creator has explicitly forfeited copyright protection for all purposes, or in certain limited circumstances, such as works created by the U.S. government.
For music that has fallen into the public domain in the United States, there is a complicated set of rules based on how the laws evolved. For a rule of thumb, as of 2022, any sound recordings released before 1922 are in the public domain, while musical works published with a valid copyright notice of 1926 or earlier are in the public domain. Remember, while a composition may be part of the public domain, a particular sound recording may not be because the composition and sound recording copyright may belong to different copyright owners and may be created at different times. For example, Bach’s Cello Suite No. 21 is part of the public domain, and any person may record themselves playing it and sell that recording. However, you can not sample Yo Yo Ma’s recording of him playing it without his permission.
Just because you can find a copy of the work for free online does not mean it is in the public domain!
Also, “royalty free” does not mean the work is in the public domain either. It simply means that in certain situations, certain additional royalties may not apply.