Science values openness. If you want to claim you are the first to do something, you have to publish it. You can pursue experiments on your own and never share the results. But when someone publishes the same results, the first public results "win."
In addition to just following the "rules" of science to "win", the world is a richer and more interesting place with more information.