There is no single purpose of the viva, but broadly speaking it tests a student's ability to act like a researcher. It is not easy to define what does "being a researcher" mean, but the list of skills required definitely includes such things as:
- understanding the importance of the problem and its place in a wide picture of research
- choice of appropriate method to solve the problem
- ability to find a sound, elegant and technically accurate solution
- ability to communicate the solution for different audiences
Many undergraduate assessments only test skill 3 from the list and (partly) skill 2. When students prepare a coursework or sit an exam, they always communicate their results in a certain style, typically in writing, and written for the single reader: the lecturer running the module.
Unlike a typical assessment, the format of viva allows three-way communication between the student, the text of thesis, and the readers / examiners. The opportunity to ask student a question about the text changes the game completely for all parties. For the student, the task is not only to write and present a text with the solution, but also to understand the solution, the questions which may be marginally connected with the topic of the text — a «big picture». For examiners, the goal is not only to check the formal correctness of the arguments, but also to make sure the student can freely use these arguments, and apply them to problems within the big picture.
Answering your specific question: it does not matter, what does the supervisor know. In viva, you, as a researcher, present the thesis. Your skill to be solely responsible for the text you produced is what is tested, not the text per se. It is you, who should focus the examiners on the important parts of your thesis. Through the way how you present the research, you should be able to create a right context, and to attract the attention to the strongest parts of your thesis. Success in this part will invite comfortable questions; failure will result in a number of random questions distributed all over your thesis, which you'll have to answer. If you feel really uncomfortable talking about (some) part of your thesis, you possibly should ask yourself, why this topic is still a part of your thesis in the first place.