I have seen this happen a number of times while I was running Eircom's M&A activity. Our legal due diligence team would find issues with IP in a prospective investment or acquisition. This would often be expensive and time consuming to remedy, or might even derail the whole transaction.
The most common fault was to omit an IP ownership clause in the contracts of employment of developers (particularly in software companies). This is easy to do in the frenzy of developing new products, getting them to market and keeping the cash flow going. The remedy is to have the employment contract re-signed with the IP clauses included. This may not always be possible and can be costly. Better to do it from day one!
Sometimes a software company would develop a good bespoke application for a particular customer and then realise that this application could be used widely by other similar customers - in other words, it could be "productised". This is potentially very good news for a business, as it can generate "scalability", which adds significant value. The issue here is that the original customer will (if properly advised) have retained ownership of the IP it paid for. The software company must either obtain permission to use the IP (which may be refused if the new customers are competitors of the original customer), or rewrite the code from scratch.
If your company creates bespoke software (or other products), the message is - try to retain ownership of IP created if you can, and have this as a term of your contract.
Intellectual property is a wide subject, with many other potential pitfalls for businesses. It includes patents, trade marks, trading names, domain names, copyright and designs. My advice is to get specialist advice at an early stage, as IP issues are easy to prevent but may be very expensive or impossible to remedy later.