What effect does leaving guardianship to your children in your will have?

This is not an actual case therefore not in IMHO but I’ll use my family dynamic to illustrate.
Let’s say my stepson and his wife leave custody of their child to Mrs Cad (and I guess me but not important to the discussion) and then they die. Now suppose Mrs Cad’s ex-husband (blood grandfather) and/or daughter-in-law’s sister come to Colorado and fight for custody. Assume my granddaughter is still a minor.
Does age matter? Is there a certain age where she would be asked who she wants to live with?
What would they have to do to get custody or deny us custody?
Would that part of the will just get tossed? Would it be the determining factor? Would it be suggestive but not binding?

Guardianship bestowed by the parents is legally binding. Let’s say they didn’t name your wife (grandma) but the father’s college roommate (not even related to the child). That is binding and blood relatives cannot overturn that decision. Sure they can challenge it, but will likely not prevail, just on the emotional need for their grandchild to be with them.

However the named guardian can refuse to accept the guardianship, which is why it is important as parents to discuss these types of decisions with the proposed guardians. If the named guardian refuses, then the court makes the decision.

Also to clarify, guardianships normally only apply in the case where both parents are deceased. If only one parent dies, the surviving parent becomes the sole parent.

I can only say what happens in my but I think it’s generally similar in most states. Appointing someone the guardian in your will isn’t enough- that tells everyone who the parents wish to be the guardian but a court order will still be needed to interact with schools, banks, medical providers and so on. So the proposed guardian will need to file a court petition. A child over the age of 14 is asked for their preference but that preference is not binding. Certain parties (other grandparents and siblings for sure, possibly aunts and uncles as well) have the legal right to object and they must be notified. I’m sure that most of the time the court appoints the person designated in the will but courts are not obligated to appoint that person no matter what and therefore it’s possible for the will to say your wife gets custody but the court appoints her ex-husband or the mother’s sister.

A guardian can be appointed for the person, the property or both. And there can be separate guardians , one for the person and another for the property.

So what would a challenge look like? Is it enough for the complaintant to say “I’m a closer relative”? Does that matter? Or is it “I am closer/more familiar to the children than X”? Or do they need to prove"X is not capable of being a good guardian" as happens in custody disputes?

" I’m a closer relative" in terms of bloodline is not going to be enough. I suppose it might matter if everything else is equal , but everything else won’t be equal if the parent(s) designated a guardian. But decisions made regarding guardianship of a child are going to be made on the best interests of that child - which might involve one person having a closer relationship to the child than the other. It might involve one person being better suited to be a guardian but it doesn’t have to go as far as one person not being capable. There really isn’t “joint guardianship” in the same way that “joint legal custody” exists* - you can have a guardian of the person and a separate guardian of the property but not two people who jointly make decisions about the child’s extra-curricular activities or medical care.

A guardian of the person who is not the lineal guardian specified by statute must be appointed by a court. In Florida, and I suspect in most states, the standard is “best interest of the child.” The wishes of the parent are a factor but not the most important.