In a culture like ours, which is heavily influenced by British common law, wills and trusts have an interesting history. Wills' bequests have been the main focus of a lot of mystery fiction, where secretive and worried relatives wait around a long, imposing table to hear what will happen to the family fortune and, by extension, what will happen to them. As usual, fiction and the media only tell one side of a story, while the other side can be found behind the scenes or on a back page of a newspaper.
Wills are often not shown to be contested, though. Maybe this is because people are just starting to like legal courtroom drama, or maybe it's because the way family members treat each other over big amounts of money is too violent even for TV. Wills are often fought over in long, bitter fights that hurt everyone in the family. Often, there are two camps that are at odds with each other, and each family member must decide which "side" they will be on. It's nice when both sides sincerely agree that they want to do what they think the dead person would have wanted, but more often than not, that's just the spell that each side says to get what they think is theirs.
One way to fight against a will is to say that the person who made it was insane when they did it. So, even non-lawyers usually start their wills with "I (so-and-so), being of sound mind and body..." This legal theory doesn't just apply to wills; it also affects the right to make all kinds of contracts and agreements. This is called "capacity" when it comes to wills.
Capacity can be broken down into two parts. First, the person making the will can't have a mental illness. Most of the time, this means that the person making the will needs to know what they own, who will get it, and how the person will get what they are supposed to get. These things work together, so the person making the will needs to know how they fit together. It seems that the way this law is used is changing because of videotapes where the dead person talks about the whole process. On-screen, the person who died talks about who gets what, why, and how that affects the rest of his or her property. Note that the test for mental deficiency is not how well the person understands the world in general, but how well they understand what they own. It's tempting to wonder if this requirement comes from the fact that rich people in our society are allowed to be "eccentric" to a certain extent.
The second part of figuring out if someone is able to make a will is whether or not they have a "insane delusion" or "mental derangement." But, again, this crazy delusion or "false belief against reason" is not about anything other than the assets in the will. Even if someone has a crazy belief that goes against reason, it doesn't matter as long as it doesn't affect how the will divides the property. If someone thinks they see dead people but doesn't try to leave any of them money, that's probably fine. Most of the time, crazy delusions involve the irrational belief that someone is not the deceased's child or that the deceased spouse was unfaithful to the marriage. But again, the person who died could have had a lot of crazy ideas about things other than their property, and that wouldn't make their will invalid.