Then I remember tales like "The Frog Princess" where the kings set tasks to determine who's going to be the heir. Or "The Water of Life" where the older princes both think that if they win the Water of Life, they will be named heir.
On the other hand, they always have the choice of heirs. Never primogeniture, nor (despite what everyone knows) ultimogeniture are the law in fairy tales. The youngest son inherits because his brothers are executed, or he's explicitly chosen, or his brothers surrender their claims to his superiority.
Hmmm. . . the king can choose. Either one heir or to divide the kingdom. Probably the first is most likely when division would lead to a postage stamp kingdom; after all, if it's too small it can't support a king. Or perhaps some practice partible inheritance and others let the king choose. I suspect the first often has the king's setting challenges to their sons in hopes that some will marry away.
Of course, this is all in a setting where kings and princes routinely marry goosegirls, or peasant girls who set out to seek their fortune. The only question being whether they have to have a fairy tale to make it respectable. For obvious reasons, if they can just do it -- it doesn't appear in fairy tales!