A PhD typically takes at least three years. A viva typically takes three hours at most.
Writing a thesis could take months of effort. Preparation for the viva takes maybe a few dozen hours.
The viva takes a fraction of the time you spend preparing for it. Preparation takes a fraction of the time spent writing your thesis – which in turn is only a fraction of the time you spend working towards your doctorate.
The fractions matter, but not as much as the whole they are part of: the viva is important, prep is important, but the real difference that helps you pass your PhD comes from the work you do over a long period of time.