> Sometimes yes, sometimes no.
No. It always comes from scarcity of some kind.
In the case of consulting, the scarcity might be expertise in putting together some kind of enterprisey system, but there is always going to be scarcity, otherwise no money will be exchanged.
And you can rest assured that IBM has made plenty of money from IP itself over the years - they're no strangers to software or any other kind of patents, nor selling software like DB2. Also: do you think that IBM's services division would make as much money if they posted all their code to the internet? I bet many of their clients believe (right or wrong) that the custom solutions they're getting are a competitive advantage and do not want to freely share them with the competition who is not shelling out big bucks to IBM.
With regards to Google's IP, you can be very sure that they would invoke all kinds of IP laws were someone to walk out of their HQ and post important bits and pieces of their search engine tech to the internet. These days, they're in a pretty good position to survive in any case, but think about trying to start a company and have no way of doing anything if people walked out and posted your "crown jewels" to the internet.