Patents encourage innovation. In exchange for publishing your tech, you get protection from those who might copy it for ~10-20 years. You get to make money from it and the world benefits from knowing the details of your technology.
This is stated theory of why patents work, not actual evidence that they work.
The alternative is easy to imagine. Companies either do not innovate or they protect IP on their own by keeping it secret. That may entail keeping headcount low and more overhead for security.
So, less jobs, less innovation, less sharing of development, and more duplication of security efforts that are shared by every company. Getting rid of patents would be a recipe for further entrenching existing wealth. You'd have no protection from a major corporation replicating your garage-company's processes. As it is, companies have a hard enough time fending off the likes of China which does not respect western IP.
This is stated theory of why patents work, not actual evidence that they work.