When you file a non-provisional application, you have a choice of whether or not you want the application to be made available to the public for review (i.e., published). If the application is published, but you are not granted a patent, the subject matter of your application enters the public domain.
If you choose not to publish the application, and your application is not granted patent, the subject matter of your application does not enter the public domain. However, if you choose not to publish the application you and are granted a patent: 1) you are forbidden from filing international patent protection in most countries; and 2) you will only be able to collect royalties on your patent from the time of patent grant, whereas if you had opted to publish your patent application at the time of filing, you may be able to collect royalties from infringes from the date of your patent filing date.