So, the FL ending up in the republic was part of a conspiracy. The royal family knew that the republic had refused her as reparation, but didn't tell her father so she'd be sent anyways in an attempt to ruin her, with the reason beinf that her father basically has the Midas touch when it comes to business, and the royal family interferes with her life to keep him in check because they're paranoid and power hungry, despite the fact that he has no ambitions for the throne and works for the good of the kingdom. FL's stepmother is also a plant by the royal family and she wants the FL gone so she can be the "true" mistress of the house.
The republic has a lot of valuable natural resources and fertile land that the empire has taken advantage of up to this point, so the ML's goal is to take that economic power and bring it back to the republic's people, so he strikes a deal with the FL that, if she pays back her kingdom's debt by using her business acumen to renegotiate the contracts of various exporters to be more favourable to the republic's people, he will consider everything water under the bridge and allow her to remain in the republic. The FL manages to repay her debt within a year because it turns out they were unknowingly getting that short changed for their wheat. She also opens the avenues for various local specialties to be traded, bringing even more income to the republic.
Meanwhile in the empire, the emperor's second son, born of a concubine, is a very intelligent boy, but he keeps his true talent hidden because he and his mother are being kept in check by the empress, and he resents his situation somewhat, especially since he doesn't want to fight his older brother over the throne. After he meets the FL, he's inspired to finally use his full potential, and a plan is formed: to depose the royal family of the FL's kingdom and have him take the throne there. (Since the kingdom is a vassal to the empire, this would be legitimate.) The culture of the FL's kingdom is that competence is valued above all else, and it's only natural to remove someone unsuited for a position, so everyone just kind of shrugs their shoulders and is relieved that the foolish royal family is no longer in power.
The story ends with the FL and ML together, the republic prosperous, and the prince finally able to flourish.