I will address Moriori specifically, as based on the way your question is framed, it seems that you have may have fallen victim to a long perpetuated myth regarding their origin.
During the late 19th and early 20th century, the prevailing narrative regarding the history of the settlement of NZ was thus: NZ had been discovered by Kupe around 950CE and over the next 200 years had been settled by the people who would become the Moriori. Then Maori had arrived from Polynesia and over the next 200 years either conquered or assimilated most of the Moriori and driven the last of them to the Chatham Islands, an isolated archipelago around 800km east of the South Island of NZ. There they remained until after European contact and in 1835 were invaded by displaced Taranaki Maori who killed and enslaved the entire population.
This narrative was widely disseminated, not least because it formed part of the primary school curriculum until the 1960s, long after this narrative had begun to be criticised by NZ historians. Moriori were almost always depicted as being a less sophisticated people than the Maori and possibly originating from Melanesia, rather than Polynesia.
This narrative was convenient for Pakeha (non-Maori) during the late 19th and early 20th century who were watching the decline of Maori culture and people in front of their eyes. Just as the Moriori had been conquered and replaced by a more sophisticated people so to would be the fate of Maori, it seemed to be the natural order of things. Later in the 20th century, the idea that the Moriori had been the first to settle in NZ became highly politicised as Maori sought redress and reparation from the Crown (i.e. the NZ Government) for breaches of their rights and Crown obligations under the Treaty of Waitangi. "Well they killed off the Moriori so why do they get to claim NZ" or arguments to that effect were used (and sadly still are) by some sectors of society to downplay Maori grievances.
By the latter part of the 20th century this narrative, described by NZ ethnologist David Simmons as The Great New Zealand Myth in his 1976 book by the same name, had been completely discredited by professional historians.
Virtually all substantial evidence points to New Zealand being discovered and settled from eastern Polynesia, specifically the Cook Island Group and the Society Islands, starting at some time during the 13th century. Multiple settlements occurred, including return journeys between NZ and eastern Polynesia as evidenced by tools found on the Kermadec Islands made from stone sourced from the NZ mainland and DNA analysis of Kiore (Polynesian rat, introduced to NZ by early Maori as a food source) bones also found there. These voyages, with a large migration likely occurring during the mid 14th century, appear to have continued until around 1500 AD at the latest.
During this time, sometime during the 14th or 15th century, the Chatham Islands were settled from the NZ mainland. Kiore DNA evidence shows that a single large settlement occurred and these settlers would become known as Moriori. We have no evidence to suggest that these people are not the descendants of the same early Polynesian settlers of the NZ as Maori. Again tools made of stone from the NZ mainland and Kiore DNA indicate that settlement occurred from NZ and not as a separate migration made directly from eastern Polynesia.
After migrating to the Chatham Islands, the Moriori and Maori seem to have promptly forgotten about each other existing. Isolated from the mainland the Moriori developed their own distinct culture. The Chatham Islands were too cold to cultivate Kumara (sweet potato), the staple crop of Maori, so the Moriori lived as a hunter-gatherer society with fish, marine mammals and seabirds comprising a large part of their diet. They were also a pacifist society, with oral tradition telling that heated disputes were settled by "duel", the duel being a fight with thin sticks, and only until the first drop of blood was drawn. This practice of pacifism, referred to by Moriori as nunuku-whenua may have been a necessity to sustain the small population in the harsh conditions of the Chatham Islands. This pacifism can be seen in contrast to significant role that warfare would play in the Maori culture developing on the mainland. While they developed their own language, it still featured strong similarities to Maori and shared around 70% of the same vocabulary.
Following the arrival of the British ship HMS Chatham to the eponymous islands in 1791, the Moriori and Maori were reintroduced to each other, sometime just after 1800CE as a result of European vessels visiting the Chatham Islands. It was at this time the Chatham Islanders gave themselves the name Moriori (equivalent of Maori in their own language). Later, in 1835 Maori from the Ngati Tama and Ngati Mutunga iwi (Maori tribes, for the sake of brevity) who were living in Wellington, having been displaced from their land in the Taranaki region due to the Musket Wars, commandeered the brig Lord Rodney and transported themselves to the Chatham Islands. There, after a brief uneasy coexistence, the Maori claimed ownership of the Islands. A meeting of Moriori elders was called where it was decided they would uphold the practice of nunuku-whenua. The Maori, perhaps expecting the meeting to be a prelude to war as it often was on the mainland, promptly attacked and killed or enslaved all the Moriori. The details of this slaughter as passed down by Moriori oral tradition are harrowing to say the least.
So in brief, the Maori and Moriori share the same origins as they are ultimately both decsendents of the same eastern Polynesians who settled New Zealand.
I have relied largely on the late NZ historian Michael King in writing this response, specifically Moriori: A People Rediscovered (1989) and The Penguin History of New Zealand (2003).
As an explanatory note, where I refer to the "mainland" of New Zealand, I am referring to the main landmass of NZ, comprising the North, South and Stewart Islands and their nearby offshore Islands. Both the Chatham and Kermedec Islands form part of New Zealand in the present day.