A guardian ad litem is typically a guardian that is appointed for a person for a very specific purpose. In many cases, this type of guardian is appointed with the minor is being sued for some reason, typically because they are an heir to some property that is a part of the lawsuit.
If there's a title dispute to real owned by a deceased person, there may be minor heirs of that person who technically are part of the suit. They may never have had guardians appointed. The judge may appoint a guardian ad litem for the minor to make certain the minor's interests are represented. The guardian's only function usually involves the specific court case and the appointment is usually temporary.