It might be best to settle out of court if the parties do not have the means to wait for the full resolution from the courts or if the plaintiff is likely to win and the defendant wants to keep the details more private.
Explanation:
It would be wise for a defendant to settle out of court when the trial will be lengthy and they may not have the means to wait for a long settlement and drawn out procedure. If the injured party feels the terms of the settlement are favorable to them and they are satisfied with what is being offered, it might be in their best interest to accept as well. This also helps to keep the terms about the negotiation and deal struck more private than a trial and hearing might. If the defendant is a company for example they might want to keep information about the grievance against them private.