It's federal law. It's state law. But is it always best? Nothing works all the time. Lately that has come full circle for me. When I was a young lawyer, I represented a great aunt who had custody of a young child. She had raised the child with no help from the parents. Then the father and his girlfriend appeared. Visitation started, and even though the child was afraid of visiting with the father, he was granted custody. Parents have a preference in custody proceedings that is virtually impossible to overcome. The girlfriend later killed the child.
The guardian ad litem in that case from years ago was the guardian ad litem in a case last week. A distant aunt was seeking custody from a non-relative. Again the relative preference was coming into play. The Department of Human Services took the position that only a relative would do, even though the mother preferred the non-relative. The aunt feeds the one year old baby foods like Ramen noodles and Chef-Boy-R-Dee. No wonder that in the last 6 months the child has gained 8/10th of a pound. The other relatives joked about her actually installing child proof outlet plugs (how silly).
Sometimes, it really seems that it may be better not to remain a part of a certain family.