There are several different types of patents, including
Your Technology Licensing Office (TLO) or Tech Transfer Office will usually file for patents and pay the associated costs on your behalf. Sometimes it may make sense if starting your own company to hire your own lawyers to write the patents as the quality of the lawyers will sometimes determine the quality of the patents and whether they are granted or not.
Provisional patents can be applied for more cheaply than full patents and give the inventor one year to finalize the claims and apply for a utility patent. It allows the claim "patent pending" to be made.
Patent Breadth / Scope
Ideally a patent keeps potential competitors from being able to execute on your idea. However, in reality, there are often ways to invent around a patent. The scope or breadth of the patent claims will often determine how easy or difficult it is to invent around the patent. This is why money should not be saved in hiring good lawyers to file patents. As an example, if you have a material composition patent on a new therapeutic compound, but someone could add a methyl group and get around your patent, then that is problematic. However, if the patent also covers the mechanism of action for that entire class of compounds in their anti-epileptic activity, then this is much more broad.
The economic rationale for allowing patents is essentially a trade-off between providing incentives for R&D to be done and the disclosure of the invention to the public with the balancing desire to have competition and avoid monopolies.
The government essentially allows a short term monopoly to give the inventor the incentive to do the R&D and in exchange for making the invention public.
Research on patents suggests that patents are effective in providing this function, but particularly so only in a subset of industries (particularly chemicals, pharmaceuticals, biotech, and medical devices). Other mechanisms such as speed to market, trade secrets or ownership of complementary assets are more important in many industries.