And that’s the crux of it. Parliament has already established the line of succession, and would take active steps to alter it if the next heir was looking iffy (looking at you, Andrew Mountbatten Windsor).
Or if not popular, at least not continually changing. Governments and political parties and prime ministers come and go and are hated and loved and that whole thing switches around periodically and the landscape of hate and love inverts and so on. Necessary, but horrible.
Not so much with a monarch - they are still loved by some and hated by others, but the pot is not continually being stirred and that, I think, provides a sort of background sense of stability. Not exactly necessary, but unhorrible.