Mediation is a form of "alternative dispute resolution" — that is, a means of resolving a dispute without a court trial.
Mediation can be particularly advantageous during the divorce process because parties who are actively involved in the settlement of their divorce are far more likely to move forward in a positive vein in the post-divorce world and to abide by the terms and provisions they have agreed upon. People who have assumed a significant role in the development of the post-divorce world are more invested in achieving successful, non-confrontational outcomes, than those who have had their future imposed upon them by the court. This is especially important in cases involving children. Consider that, even though your marriage is over, you and your former spouse will be inseparably and eternally linked by your children. A "scorched earth" approach to the divorce will serve only to poison the very deep well that you two will draw from for the rest of your lives. Thus, mediation can make the divorce easier to live with in the present and long into the future.