In the first chapter of The Wildmage of Balhae Woods, the wildmage Hana is consulted by a messenger of the king. The king's only son and heir, young Prince Majun, has been examined by the court healers and mages and it has been discovered that prince is not capable of siring children. No healers or mages known to the king can cure the problem; it is hoped that Hana's outstanding scrying ability may help her locate some obscure little-known bit of magecraft that can do the trick.
In the world of Wildmage, there are many more girls born than boys, about 7 to 1. There have been historical incidents where tyrant kings have drafted scores of young women into the military to use them as shock troops in their wars against their neighbors; the women's lives were expended just to soften the enemy up for the 'real' soldiers. Because of that the idea of women soldiers is NOT considered a respectable notion and women most of all rebel against it, seeing it as an attack on their rights. So in most of the kingdoms, the Northern kingdom (where Hana lives) among them, the idea of a princess inheriting the kingship is not acceptable since the king's function is to lead his men into battle.
There are complicated rules of inheritance to help ensure male heirs. Most men have a concubine or two in addition to their wives; kings have several concubines as well as having queens. Sons of concubines can inherit from their fathers if there is no son by the Queen to take the throne. But things can get complicated as one goes further afield for heirs.
In the particular royal family we are talking about, the closest blood heir after Prince Majun is the son of a concubine, while the next closest is the son of the lawful wife. So there are two heirs with about the same level of rights. The king finds it imperative that Majun be made fit to inherit.
Hana, as a mere wildmage rather than an Order mage (who are trained in the special Order schools or in associated monastic establishment), sees this as her chance to make a name for herself. She must find a work of magecraft that will fix the problem, and resist the temptation to resort to the evil, demon-touched form of magic called sorcery.....
Notes: Prince Majun's name comes from the character Majun in the Korean drama Bread, Love and Dreams (AKA The King of Baking). Hana was a character in another Korean drama but I don't know which one. The king of the Northern kingdom also has the title "Oraha" which is a title of the ancient Korean kings of Balhae. And Balhae Woods is taken from the name of Balhae an ancient Korean kingdom.