This happens if it can be shown that, at some time before winding up proceedings began, they knew (or should have known) that there was no reasonable prospect of the company avoiding insolvent liquidation. In these circumstances a court can order the directors to make a contribution to the company’s assets.
The only defence to wrongful trading is if you can show that you took every action possible to minimise the potential loss to the company’s creditors. This makes it essential that as a director you have properly documented all the steps when your company faces the threat of insolvency.