During the Second Wizarding War, she had to be destroyed for Voldemort to finally be defeated. Nagini was killed by Neville Longbottom with Godric Gryffindor's Sword in 1998 and was the last Horcrux to be destroyed after Rowena Ravenclaw's diadem.
Nonetheless, despite her initially benevolent nature, Nagini's blood curse eventually turned her into a snake permanently. Though it is unknown if she became evil as a result of that, or was turned evil as a result of Voldemort turning her into a Horcrux. As a snake, Nagini was completely loyal to Lord Voldemort.
In short, no one knows exactly how Nagini ends up as Voldemort's closest ally. Evidently, something happened between the time of her joining Newt and the events of Harry Potter that pushed her to the dark side. She might even have met Voldemort while still human, and he was Tom Riddle.
Nagini didn't appear in Fantastic Beasts 3 - most likely because of Claudia Kim's pregnancy amidst the Covid-19 pandemic, but this also makes sense in-universe, as she couldn't have come close to Grindelwald without putting herself in grave danger.
She's never received a proper history — even in all of author J.K. Rowling's additions, confirmations and revisions of Harry Potter lore in recent years. Fans have widely believed up until now that Lord Voldemort first came across Nagini during his exile in Albania after his fall in 1981.
Unless one or the other has a significantly smaller role in the films than we are led to believe, Dumbledore and Nagini will get to know each other. From the very little we see of Nagini, it looks like she's at least potentially on the same side as Dumbledore.
It wasn't just inanimate objects that could become Horcruxes. Lord Voldemort's beloved snake companion, Nagini, was also transformed into one, and Dumbledore seemed to know it, ominously predicting that a day would come where Voldemort would 'fear for his snake'.
Nagini seemed integral to Lord Voldemort's survival before he could be restored to his body, and we learnt, quite grotesquely, that Voldemort even tasked Wormtail to 'milk' Nagini so he could live off her venom to keep his strength up.
Nonetheless, despite her initially benevolent nature, Nagini's blood curse eventually turned her into a snake permanetly. Though it is unknown if she became evil as a result of that, or was turned evil as a result of Voldemort turning her into a Horcrux. As a snake, Nagini was completely loyal to Lord Voldemort.
Though it may later be revealed that the Dark Lord did indeed know that Nagini was a Maledictus, there's currently no indication that he (or anyone else) ever thought that she was anything other than a snake who was made into one of the Dark Lord's Horcruxes.
When Harry and Hermione are on the first floor of Bathilda's house, Nagini (inside the corpse of Bathilda) tells Harry to "Come!" from the next room in Parseltongue. In reaction, Hermione jumps and clutches Harry's arm, and the two of them obey the command.
Voldemort had a special relationship with Nagini, as she was his pet and one of his Horcruxes. According to Dumbledore, Voldemort had strong feelings for Nagini that he had not for anyone else; she was the one living thing that he had ever cared about.
Nagini the Snake
Nagini was the last horcrux to be destroyed and also the last to be made. It was created when Peter Pettigrew bumped into Ministry of Magic employee Bertha Jorkins in Albania while Voldemort was still weak.
Voldemort possesses Nagini because she's immortal.
If he had possessed a Maledictus, a person of magical descent cursed to permanently become a beast, he would have more power. This would explain how Nagini came to be the perfect horcrux.
"The Secrets of Dumbledore" circumvents the timeline issues by revealing that Credence — or rather, Aurelius — isn't Albus' brother. He's Aberforth's son, which makes him Albus' nephew.
Once he learned that his horcruxes were being hunted, he knew Nagini was at risk. He couldn't know how his enemies had been able to find his other horcruxes, but he had to suspect at the least the possibility that it was by some magical means unknown to him, perhaps devised by Dumbledore.
Nagini's Future After The Fantastic Beasts Movies
From that point on, she goes to the forests of Albania, presumably to live out the rest of her life as a gargantuan creature, perpetually bound in her scaly form. While in Albania, she's confronted by Voldemort and becomes his most loyal servant.
The second film in the series, written by Harry Potter architect, J.K. Rowling, revealed in a trailer that fans had been on the right trail. Nagini, it turns out, was actually a Maledictus—a witch with a blood curse that turns her permanently into a beast (in her case, a giant snake).
“Yes, it's rather funny, really, that next to no-one realised the snake that Harry set free in Philosopher's Stone turned out to be Voldemort's final Horcrux, Nagini.” — J.K. Rowling. However, both the zoo snake and Nagini were played by pythons in the movies.
In the belief that the Elder Wand will grant its allegiance only to one who has slain its previous owner, Lord Voldemort has his pet snake, Nagini, kill Severus Snape.
In 1994, Death Eater Peter Pettigrew milked the venom from Nagini's fangs and used it, along with unicorn blood, to concoct a dark potion, which allowed Lord Voldemort's shattered soul to regain a rudimentary, but physical form.
He always seemed like he truly loved Nagini. He must have felt something for Nagini or he wouldn't have given her a part of his soul.
This means that the killing curse (if I'm correct) has the power to destroy horcruxes. But when Ron and Hermione are about to die by Nagini, Ron casts the killing curse as a last resort and it simply rebounds off Nagini as it was nothing.
Harry Potter and the Deathly Hallows
In this book, Rowling reveals that Bellatrix is the guardian of Helga Hufflepuff's cup (though she is unaware that it is a Horcrux), which Voldemort has entrusted the Lestranges to keep in their Gringotts vault.
Sorcerer's Stone - he speaks to the snake in the cage at the zoo. Chamber of Secrets - he tells Draco's conjured snake not to attack another student. Deathly Hollows - he speaks with Bathilda Bagshot (who is actually Nagini).