Palpatine's final plan in The Rise of Skywalker doesn't seem very well thought out, especially when compared to his best-ever evil scheme, Order 66. He's barely hanging on to life in Exegol, but somehow has assembled the greatest fleet in Star Wars history to take over the universe, renewed body permitting. So how did those logistics come together? This theory suggests a tried and true method: a wealthy investor.
The details of the financial and economic aspects of the Star Wars are a little bit murky. We know bounty hunters and smugglers work for credits, but they're inconsistently used in the shows and films. As Watto says at one point in The Phantom Menace, "Republic credits are no good out here." Palpatine had quite a bit of money due to his status as the heir to a minor royal family, but it's doubtful that inheritance would last the dozens of years between then and the events of Rise of Skywalker.
The solution lies in the Czerka Corporation, otherwise known as Czerka Arms, who manufactured weapons for the Sith. Considering their close business associations, wouldn't it make sense for Palpatine to ask them for assistance, knowing that if he takes over it will be a whole bunch of new business for them. Somebody has to make the blasters for the stormtroopers to miss with.
Czerka Arms is thousands of years old, in the non-canon Star Wars Legends, they were assisting the Sith during the Jedi Civil War more than 3,000 years before the events of the original trilogy, seen in the video game Star Wars: Knights of the Old Republic. If the Sith can survive that long, it's not farfetched to say a company as lucrative as an arms dealer in a universe that seems to constantly be at war would hang around as well.
Where were they hiding? Exegol, of course. Palpatine would want to have them on hand and nearby — he's seen too many betrayals to lose track of his remaining allies. They could have been lying in wait, slowly amassing (and funding) his gigantic fleet for their appearance in Rise of Skywalker.
This just goes to show Palpatine's boundless cunning. He's always had a plan B, whether it's substituting himself as Sith Emperor after the death of Snoke, or keeping a massive conglomeration hidden so he could use them to spring a surprise army on the Rebel forces. He may now be (finally) dead, but he put up as much fight as he could.