In Virginia, and my understanding is that this is true in most states, the standard is the best interests of the child.
Where one parent has a good track record as primary caretaker and the other parent has no track record as primary caretaker, courts are not likely to switch primary custody from the parent with a good track record to the parent with no track record.
Where both parents have contributed so much care that the track record of both is well known, and good, then the parties are on equal footing, in my opinion.
Parenting is a long recognized liberty interest. Guardianship is a statutory right, a privilege given by, and managed by the state. As you know, the standards of review are quite different. Custody statutes have always been enacted to regulate the placement of wards. Because the revised (compiled) statutes are no longer organized by subject matter, the revisors office, welfare agencies, and the bar association, along with special interest groups have effectively mixed laws dealing with different subject matter (guardianship/domestic relations, "child support"/support money, lawn maintenance/"restricted use" applicators, etc.). A review of the history in your state will bear this out.
These defences are still available for those who dare to buck the status quo. My research is well documented. Look at the cases used to justify your earliest decisions. You will find references to guardianship regulations and succesive cases will cite these.
If some of you are scared to death about defending a fathers natural right to the custody of his children, consider what so called equal rights and no-fault divorce has done for the institution of marriage and for illigitimacy rates. That is not to say a good share of mothers shouldn't have custody. A good share, these days, should. That's another problem. The incentives are all wrong. Long established natural rights are being ignored and unlawfully compromised.