An event such as a massive stroke or an illness such as Alzheimer's may progress to a point where your parent or in-law is unable to make safe and competent decisions. She is unable to understand information as it is given to her or evaluate choices. There is no clear line defining competency, and just because she disagrees with a choice, such as refusing treatment, does not make her incompetent.
Determining competency is a complex matter and will most likely involve the physician as well as a lawyer, and quite possibly even a judge and jury, to determine what matters she is incapable of handling and to what extent she needs guardianship or assistance.
Having a health-care proxy or other durable power of attorney can help expedite decisions in this matter, or at least not delay treatment of medical matters. In fact, a health-care proxy may be all that is necessary at this point to keep your parent safe. However, if these documents don't give you enough power to control the situation for him, it may be necessary to go to court to have him declared incompetent, but this should be a last resort.
Every state has its own laws about guardianship and they are very strict. Being declared incompetent strips your parent of certain rights, such as the right to vote, buy or sell property, drive, handle financial affairs, and make medical decisions.
If determined to be incompetent, a guardian is appointed who must report back to the court periodically on the status of the person and her affairs. You or another family member might be the appointed guardian, or it can be an outsider. The extent of the authority the guardian is allowed is determined by the court and your parent's abilities.