When parents can’t agree on who the kids will live with the Court will normally order a social study be conducted. This allows for a non-party, a trained professional, to look at the situation, the concerns of each party, and make a recommendation to the Court. That recommendation is the social study.
This expert will interview each party as well as watch the interactions between the parties and the kids. They will normally also interview other children or adults that are living in the residences of the parties (should there be any) and do a home visit of each parties home to make sure it is appropriate / safe for the children.
Once the expert is done, they draft the social study. In some jurisdictions, only the attorneys and the judge will see the result. This is because there have been times when parties have not liked the results of the social study and either share them with the children or even take out their frustrations on the children.
If you are going through a social study, be honest, participate fully, and make sure you comply fully with any requests. Talk with your attorney if you have questions.
A quick overview of the process in Dallas County can be found here.