For a few years in the recent past I was a consultant on a number of patent suits - both defense and offense. The patents were mostly computer software (my area of expertise) and a few hardware. In the course of this work I read over 1,000 patents and studied 100-200 of them in detail. In my opinion most of these patents should never have been issued because they weren't original ideas or they were obvious.
One of the main requirements of patentability is that the invention being patented is not obvious, meaning that a "person having ordinary skill in the art" would not know how to solve the problem at which the invention is directed by using exactly the same mechanism. That is pretty hard to check.
My understanding is that the patent examiners have very little time to review each application. And believe me it takes a lot of time because you have to relate the claims (the statements of what is being patented) to the often poorly-written design description which is needed to clarify what the claims actually mean. And then there is reference documentation and cited patents that are similar (but cited to show that this invention is something new) which should be checked and finally there is knowledge about the "state-of-the art" which is needed to judge whether the invention is actually new.
And then if a patent is issued and the holder sues for infringement a lot of sleuthing has to be done to defend the suit. I remember one patent that I worked on whose holder sued two companies for infringement. I thought the idea was clever but not really original and the patent shouldn't have been issued. The patent holder hadn't succeeded in making his own product.
Both cases were in Discovery Mode and thus I was given the source code and technical documentation of both products - there was a lot of it; if printed each wold have been ~1,000 pages or more.
It was interesting to note that one of the products was written in C and it was very messy code because the product had to be able to run on Macs, Windows, a DEC OS, a Novell OS and Unix and thus had to deal with machine and OS differences when compiled. How they ever got that mess to work is a good question. The other product was mostly written in Java which made it and was much easier to understand and I'd suspect was a more reliable product; it's design documentation was much clearer too.
I wrote some tools to examine the source code to look for potentially infringing code and think I found all the right stuff. I wrote up my findings, and went over it multiple times with the attorney. One case was going to go to trial and I didn't want to participate since it would have meant traveling to Chicago several times and hanging around with little to do; so I declined to do more work. My understanding was that neither case actually went to court (this is what usually happens), but there was some form of settlement. Both companies that were suing were bought by larger companies and I don't know what happened to the products.
If that patent hadn't been issued I and the attorneys wouldn't have earned any money; other than that nothing else in the world would be different. Patenting things that shouldn't be patented and then dealing with the subsequent law suits is a big industry that keep lots of people employed. There are people/companies who buy patents and then sue for infringement - they are called Patent Trolls. It is estimated that patent trolling in the US resulted in 29 billion dollars of costs in 2011.