A few loosely connected thoughts…
The viva is bigger in some ways than the thesis, but takes much less time (to read or write!).
A lot of focus is given to the viva, but without a good thesis you won’t pass your PhD.
Your thesis has to be good. Your viva has to go well. The former helps the latter.
Your thesis prompts the discussion for the viva, but doesn’t hold all the questions (or answers).
You don’t have a viva without a thesis first, and you don’t need to prepare for your viva until your thesis is finished.