Preprints are research outputs shared online in a trusted open platform in advance of formal peer review or submission to a publisher for formal publication. "Preprints" as a genre of research communication commonly refers to manuscripts, but other works may also be posted and disseminated through preprint servers: student theses, conference presentations, supplementary data, code, computational narratives (e.g., Jupyter or R notebooks), or any other research evidence that underlies the claims represented in a paper.
Posting research outputs to a preprint service allow researchers to receive peer feedback prior to formal publication of results. It also facilitates faster, more open dissemination of research findings. Because trusted preprint servers assign persistent identifiers to each submission (such as a DOI or an arXiv id), these works are citeable and persistent .
Increasingly, publishers and funders recognize preprints as 'first class' research outputs that may be referenced in proposals or publications. Most are also clarifying their 'prior publication' policies to allow preprints to be openly disseminated without harming formal publication downstream.
When an author produces an original manuscript, copyright in the work generally belongs to that author unless or until the author transfers ownership to another party such as a publisher (check Caltech Copyright Policy for details on when the author may not own copyright).
A preprint represents the manuscript before publication, so copyright is held by the preprint's author(s). The authors have the legal right to post their work to a public server and allow others to read and download it. If copyright has not been transferred to the publisher, there is no legal risk for posting the preprint.
Is there a risk of being refused publication if the manuscript has been posted to a preprint service? The answer is "it depends." Many reputable publishers in Earth and Planetary Science accept manuscripts posted first as preprints. See AGU's policy for example. But others may prefer you check with them before posting.