According to law, you have the right to leave your estate (that is, your net worth accumulated over your life) to whomever you choose. When you pass away, this should be administered according to your wishes. However sometimes a Will is contested, that is, argued against.
Spouses, de facto partners, family members or others who can show that they were dependent on the person who passed away may contest the Will. There may be argument that the Will was signed by the deceased when they were unable to understand the contents, or there may be an argument that the Will was signed under the influence of someone else who wanted to take advantage.
On the other hand, if there was no Will, there are laws in place that dictate how an estate should be distributed.