For the first half of the movie, he's literally just a good, reasonable man who saw everything he loved violently destroyed when he was young, was clearly traumatized by it, and has since devoted his life to ensuring that nothing like that happens to the people he's taken under his wing. He bonds with Asha over their mutual desire to protect the kingdom and the hopes and dreams of the people (which is implied to be a rare thing for him) and afterwards asks her to become his apprentice. When she immediately turns around and tries to abuse nepotism by asking him to grant her grandpa's wish, he legit looks as though she just punched him in the gut and tells her that usually people wait a few months before asking things of him. And despite her clearly breaking his heart, he still immediately agrees to look at peepaw's wish with a smile on his face!
Asha later summons the star and its power shoots through the kingdom and fucks with the people and the wishes which freaks him out because he thinks that something's threatening the safety of his kingdom, which (as previously stated) is the thing he's devoted his entire life to preventing. He tries asking the citizenry for information on the weird magic, but Asha's Seven Diverse Individuals friend group is in the crowd acting as agitators. His people just start asking about wishes and then yelling at him to grant more wishes. He gets angry and desperate since the people are being selfish twats during a national security threat and he still can't figure out what the (believed) threat to his people is, so he turns to a dark magic book in his library for answers and it possesses him. He then acts as an evil crazy dick for the rest of the movie.
The evil cursed book claims that anyone who uses its evil magic is tooootally forever lost and enslaved to it, don't bother to try saving them, they're a lost cause (because an evil at least semisentient cursed book would never lie, no sir!) His wife reads that, and despite him being nothing but a loving and affectionate husband before getting possessed, fucking immediately believes the devil book and goes "shit guess we better kill the guy then"
Yada, yada, yada, there's a big battle at the end, and the king ends up getting sealed eternally in his staff which feels like an absolutely horrific fate for a good man who only got fucking possessed after he desperately tried to protect his people. After he's defeated, his wife just makes a smug comment about locking the staff in a dank dungeon before assuming the crown herself and everyone's just like YAYYY YASSS KWEEN!!!! I was left staring at my computer screen absolutely stunned at how genuinely fucking vile it all was.