Children don't always have only two parents. Some in divorced families have two sets of mothers and two sets of fathers. Even though only two people are biologically related to a child, that doesn't mean a third person isn't as involved or doesn't deserve the same legal rights as the biological parents.
Of course, every situation is a little different, and the courts need to consider that when they're ruling on a case. It is much more common to see modern families involved in tri-parenting today than in the past, though.
For example, a homosexual couple who has a child together has at least one person who is not biologically related to that child. There may be circumstances in which a third person also wants to exercise his or her right to be a legal parent to the child as well. So, the biological mother and father may both have a legal right to raise the child. Additionally, the nonbiological spouse in a homosexual couple may choose to adopt the child and become his or her legal parent.
This situation is better for some people, because it means no one has to give up his or her right to the child. In the above situation, the biological mother or father would have to give up his or her rights completely if both people in the same-sex couple were to become parents to the child. Today, that doesn't have to happen thanks to the recognition of the need for three-party family structures.
If you need this kind of arrangement in your life, your attorney can help. It is not as unusual as it may seem, and the courts often recognize it because it's in the best interests of the child.
Source: The Fayetteville Observer, "Modern family: More courts allowing 3 parents of 1 child," Jennifer Peltz, June 26, 2017