Part of it is IP self-defence. If a big tech company does not have a corresponding patent portfolio, it may trigger legal action from likewise big patent holders. Usually someone like IBM already has related stuff to whatever you're doing and building up a portfolio is just making sure you may have something to make counter-claims. It may not always work (see Oracle vs. Google), but it's expensive to sue and the stakes are very high.