The goal of a legal guardian is to protect a person who cannot make legal decisions on their own.  The legal guardian makes decisions for the person who needs protection.  Usually, a legal guardian has to be appointed (chosen) by a court.  Before a court appoints a guardian for a person, it first has to decide that the person is incompetent (unable to make decisions on their own).

A court may choose a legal guardian for a minor child (a child under a certain age) in many different situations:

 If a child has no parents or other adults who are willing to take care of the child 
 If a child's parents die 
 If a child's parents lose custody of the child.  (This happens when a court decides that the parents are not able to take care of the child.  For example, if a parent hurts their child, or does not care for them properly, they may lose custody.) 
 If a court decides that a child's parents are incompetent (unable to make decisions on their own)

A court may also choose a legal guardian for an adult.  This happens when the court decides the adult is incompetent.  The court appoints a legal guardian to help protect the incompetent person (who is called a ward).  The legal guardian then has the right to make legal decisions for the ward.

How do legal guardians get chosen? 
Legal guardians get chosen in a few different ways.

Sometimes a parent will write a will, which explains their last wishes in case they die.  In the will, they can say who they want to take care of their child if the parent dies.  If the parent dies, a court still has to approve the person named in the will as the child's new guardian.  The new guardian does not have to be a blood relative of the parent or child.

If someone (like a person's doctor, psychiatrist, or family member) thinks that a person is incompetent, they may ask a court to choose a legal guardian.  In the United States, the court must hold a hearing to decide whether the person needs a guardian.  The person must be given a lawyer, and the court must listen to arguments from both sides.  If the court decides that the person needs a guardian, the court will choose one.  That guardian may be a family member, a friend, or a stranger.

What kind of power do legal guardians have? 
In the United States, when a court chooses a legal guardian, the court has to say specifically what decisions the guardian will be able to make for their ward.  For example, a court might say the guardian can only make medical decisions for their ward.  The ward will still have the right to make any other decisions that are not medical decisions.

Different states have different laws about types of guardianships and what decisions guardians can make.

For example, in Massachusetts, a court can appoint a Rogers Guardian, who can only make decisions about their ward's psychiatric (mental health) medicines.  The ward still has the right to make any other decisions that are not about medications.

In other states, like Pennsylvania, a court can appoint a plenary guardian, who has the right to make all decisions for the ward.  The ward has no right to make any important decisions for himself or herself.

References

Legal terms
Law occupations