In California, mediation regarding child custody/visitation matters is required prior to the judge issuing a final order in your case. You go into this mediation without your attorneys and meet with a court approved marriage and family counselor who meets with both parties in the hope that they will come to some sort of agreement. California feels that attorney's get in the way, so we are not invited. It is important that you talk to your attorney in advance to prepare you for the mediation.
Additionally in some counties, such as Alameda County, the mediator is a Recommending Counselor, meaning that if you do not reach an agreement, the Counselor will send a recommendation to the court of what they feel is in the child's best interest. The Judge often gives the recommendation great weight because they feel that the mediator must know something that they do not since the rules of evidence are different in court than in the mediator meeting. Additionally the mediator often spends a hour or so with the parties instead of just 15 min in court that the Judge sees them. Due to this it is imperative that you work with an attorney to fully understand what arguments are given higher weight, what you should bring, what issues you should focus on, etc.
Even in counties that do not have a recommendation, the counselor will provide a break down to the court of where each party stands, the likelihood that they will reach an agreement, etc. So it is very important that the mediator be on your side.