Star Wars: Emperor: The book Secrets of the Sith captures Palpatine’s thoughts and explains some of the events of Episode IX. Star Wars: The Rise of Skywalker brings back the main villain of the saga, Emperor Palpatine. His return in Episode IX was heavily criticized because the whys were barely explained, but also because they changed the official canon. It is already known, the theory of the chosen one, who embodied Anakin Skywalker and who said that he would bring balance by force. More details have now been provided about Rey’s fit within those Machiavellian plans.
The former Emperor Palpatine had been hatching his plan for the past thirty years. Hidden on the Sith planet Exegol, the original intention was to harness the influence the dark side had on Kylo Ren to make him the receptacle of his future as the new ruler of the Galactic Empire. It is not likely that Palpatine considered it an equal treatment, so it is most likely that sooner or later he will end up taking full control. Anyway, before his flirtations with the light, Sidious then noticed his granddaughter.
One more piece of information for the puzzle
The book Secrets of the Sith tries to stitch together some of the inconsistencies in Star Wars: The Rise of Skywalker and reveals that Palpatine had to adapt to the circumstances and events that were taking place, so he modified his initial plan. Therefore, it was Darth Sidious himself who sent the young woman the image of the Dark King in the Throne Room of the ramshackle Death Star. He intended, naturally, to lure her to the dark side.
At the end of The Rise of Skywalker, Rey and Ben Solo (Kylo Ren) arrive at Exogol and confront Palpatine. It is then that the old politician and Sith in the shadows until Order 66 offers his granddaughter the throne of her, through a procedure in which she must assassinate him using her hatred. And you know, fear and hatred are a direct ticket to succumbing to the dark side of the force. So many years of preparation end up on paper, because Rey does not fall into the trap and chooses the light side. And they were happy and they ate partridges. Well, partially.