While your client still needs you, they will be happy to pay your invoice.
Once a case is finalised, win or lose, your client will no longer be as happy to pay your bill.
So you need to invoice your client along the way to avoid “bill shock”.
You might also ask for a deposit up front, partly for cash flow, and partly because if your client can't afford the deposit, they won't be able to afford to pay you later.
You might also set a “credit limit”, where you ask for an additional deposit once the initial deposit is used up.
An extract from the Business Advice for Law Firms e-book by AJS