The court does not make child custody decisions lightly. Contrary to popular thought, the court also does not make these decisions with the primary focus on the parents.
Say that you and your spouse decide to get divorced after a decade of marriage. You have two young kids together, and you both want custody of them. It's natural to assume that the court is simply going to decide "who wins" and give custody to one of you. It's easy to view it as you vs. your ex, as if solving that question is the court's primary goal.
But it's not.
A focus on the children
Instead, the focus is on the children. The goal is to give them the best possible life, the life that they deserve. The court does not necessarily care about any sort of competition between you and your spouse. They're not trying to resolve your disagreements and pick which one of you should get their way.
Instead, they're trying to decide what would be best for your kids. Once they make that decision, they'll tell you how you fit into it.
Changing with time
Over the decades, the way that courts approach this has changed. Historically, courts assumed that women made better parents and men made better providers. That's why you had the cliche set-up where the mother got custody of the kids. She raised them while the father worked and then paid child support.
This standard approach has shifted to a large degree. More and more often, the courts focus on equality. They give both parents custody. They recognize that women work more often and that men are fully capable of raising their kids. The roles are not the same as they were before.
That's a great example of how the court focuses on the children's best interests. They found that it's typically better for the children to stay involved with both parents. Giving out joint custody is less about what the parents want -- they may directly state that it's not what they want -- and more about what the children need.
If you and your spouse have decided to get divorced, it is important to understand exactly how the child custody process works. You need to know how the court is going to view your case and what options you have. Above all else, you also need to know how to put the kids first and let their best interests dictate the outcome of the case.