Accounts receivable are sometimes not collected. Why do companies extend trade credit when they could insist on cash for all sales?
Extending trade credit almost all the time leads to more sales. If the incremental cashflows, involving the investment in accounts receivable give a positive NPV, the decision to extend trade credit would raise the value of the firm.