Dissolution and liquidation. The liquidation committee should take a full inventory of the IP. A trademark left unaddressed is exposed once the registrant has ceased to exist: any party may then apply to have the registration cancelled, and it will in any event lapse if no one renews it. Patents lapse when no one pays the annuities. Complete the assignments, or put a clear succession arrangement in place, before the company is deregistered.
Bankruptcy liquidation and reorganization. The IP forms part of the debtor's estate and is disposed of by the administrator. Three questions have to be worked through one by one: whether existing licenses survive, whether the licensee keeps its right to use, and who takes over pending litigation and administrative proceedings.
Division and merger. Succession of rights has to be matched by registration of the change of owner for trademarks and patents. Otherwise the registered owner and the true owner part company, which causes problems for enforcement and for any later transaction.
One practical point above all: assign the core trademarks to the surviving entity or to an affiliate before liquidation starts, and see the approval and publication through. That avoids the deadlock in which assignment is no longer possible because the company has already been deregistered.