Hoo boy.
Spoiler
Once upon a time known as the early 1800s, New Zealand/Aotearoa had two distinct groups -- the Europeans/Pakeha, and the Indigenous/Māori. Since New Zealand was being found and colonised during the Enlightenment, there was some semblance of respect between immigrant Europeans and the Māori (who were often termed as "Noble Savages," as opposed to the folks off in the Americas and Australia).
As time went on, the British Crown's representative in New Zealand (I can't recall the exact individual's name) basically went "Oh balls, if we don't do something soon, the French are going to claim and take over the southern island, and that is a bad thing." So, they organised as many Māori tribes as they could to sign a treaty. At the same time, Māori tribes were having trouble with some English colonists and wanted to ensure these colonists were subject to some regulations, and also wanted a guarantee that their land, waters, and mana (kinda like prestige but a lot more important) would be protected.
Unfortunately the fact that the Europeans were in a hurry meant that they really, really screwed up in writing this treaty. Firstly, there were two versions written -- one in English, one in Māori. I believe the translator into Māori was a whaler, but don't quote me on that. (Nope, definitely wrong about that). Since there wasn't perfect understanding between the two languages, they ended up saying different things.
The main problem was the in the English version, the Māori were signing away their sovereignty, but in the Māori version they were giving the British Crown their kāwanatanga (which was a newly minted word that not all the signers knew). Kāwanatanga means governorship. Basically, Māori signers thought they were guaranteeing their sovereignty, while the English thought Māori gave it away. Furthermore, once the initial treaty was signed additional copies of it were sent around to get the signatures of other Māori tribes who couldn't get to Waitangi. They never got to the South Island. Instead, the British panicked over French colonies and claimed sovereignty over the South through "Right of Discovery" and called it a day.
Things went downhill from there.
Nowadays, the Treaty is a mangled piece of legislature that is part of New Zealand's "Constitution," which had been regularly ignored thanks to it being very vague in legal terms and very, very difficult to enforce. On the bright side, there are efforts made to preserve Māori law and interweave it with our British-influenced laws, but a lot of people see it as "Oh, this one type of people are getting special treatment, that shouldn't happen because we should all be equal," meanwhile Māori had all of their land illegally taken, their language and traditions nearly stamped out, and so on and so on.
Fun fact: New Zealand is one of a very small number of democratic countries that DOES NOT HAVE A WRITTEN CONSTITUTION, so trying to find ways to enforce the Treaty is an effort doomed to failure. Whenever there is a discussion about writing a constitution, all the politicians have a hissy fit. Case in point, when John Key (previous Prime Minster) wanted to change New Zealand's flag because he wanted his name on Wikipedia, people brought up writing a constitution. The response was basically ehhhhhh no.
TL;DR: The Treaty of Waitangi is a controversial, poorly written, difficult-to-understand Treaty that has a massive impact on New Zealand law and is the reason why a lot of Māori dislike our government.
That said, it's a fascinating subject to study.