Looking at the other answers, this is clearly a question where academia varies more than you think.
My answer will therefore be prefaced with a long explanation of how things work in the culture of my academia.
PhD defense in physics in France
The formal procedure for a physics PhD defense in France (and I suspect the vast majority of STEM defenses) is:
- the PhD advisor must sign on the PhD manuscript and the choice of examiners. In most cases the advisor chooses the jury.
- the PhD student must send their PhD manuscript to two referees (a subset of the examiners) well in advance of the planned defense date. (In my case, two months.)
- Referees must send a preliminary report well in advance as well. (In my case, one month.) This report contains evaluation of the work quality, but it is not a binding recommendation. Only the full PhD committee may choose to award or not award the degree.
- The manuscript and preliminary reports are shared with the whole committee. Assuming the paperwork is in order, the defense takes place on the planned date.
- You present your work, after which every committee member gets a chance to ask questions.
- You leave the room and the committee deliberates. Your PhD advisor(s) may or may not be asked to leave as well (formally, the committee chair chooses).
- You come back and the chair announces the committee’s decision. It can grant the PhD, or not grant it, or grant it under the condition that certain modifications be made to the manuscript; that decision is written down in a formal report about the defense.
What actually happens is:
- your PhD advisor, by signing on the manuscript, is staking her professional reputation on the quality of the PhD.
- your manuscript/work may be poor, but still enough to graduate. If so, your advisor will usually call the jury members and apologize. If it is on the verge of failing, your advisor may play on personal favors. This should not happen, but it does - sometimes, "have the student work a couple more months to pass" is not on the table, so the unpleasant choice is "let them drop out" or "push them barely through graduation". The latter option is better for the advisor than the former.
- if a referee thinks the manuscript/work is too bad to justify a PhD, they wil not write the preliminary report; they will contact your advisor, and try to get them to withdraw the defense. Your advisor may try to push back (see above) or they may not. If they decide to cancel the defense, that decision will be made without your input. You might formally get to choose between "go to the defense against the wishes of my advisor and at least one committee member" and "cancel the defense", but that is not really a choice, is it?
- the referee report will usually be a detailed critique of the work, and contain questions that will be asked during the defense (maybe not verbatim, but it is good preparation anyway). Or it might be useless to prepare for the defense (if the referee is late writing it, or if they think it’s red tape anyway, etc.), but that reflects badly on the referee rather than the PhD student.
- by the time you are standing in front of the committee, you have already passed.... The success rate of PhD defenses is well above 99% (because you will be asked to withdraw before the defense if there are doubts, see above). If the committee grants the PhD under condition, the manuscript modifications will almost never exceed one or two days’ work.
- ...but it does not mean there are no stakes: The quality of your defense will influence the examiners’ opinion of you as a potential collaborator, postdoc, or fellow scientist; they will remember it when examining an application for a job opening or a grant. Even without this direct impact on the examiners, the defense report will be an important piece of information when you apply to junior researcher positions. A bad defense will get you a PhD, but it can tank your career.
In my field it was customary to have lunch (or dinner) with the new PhD and their committee after the defense, but I suspect this is very specific to the field or university.
Questions during the defense
After an initial 45 min presentation, the examiners will ask questions. The duration of such question time varies quite a bit, but I would say it is between 1 and 2 hours at least 80% of the time.
The president will give the floor to each (other) examiner to ask questions. Referees will start and ask the majority of questions. (In my case, the first referee had the floor for about 50 minutes, the second for 20-25; all other four non-advisor examiners combined lasted less than 20 minutes.) Advisors go last and (hopefully) ask no questions (but may make a small speech about how happy they were to have you as a PhD student, the work you made, etc.). The audience is allowed to ask questions after that (but the median amount of questions from the audience is zero).
As said above, the process is "non-adversarial" inasmuch as you are going to pass, but examiners will still ask probing questions for various reasons:
- they are interested in opening a scientific discussion (which may or may not end up with an answer to the original question, but will be interesting nonetheless)
- they have a fairly short-term interest in the answer: e.g. one of their PhD students has some issues with the same experimental apparatus
- they think the question is hard (or even impossible to answer), but they ask it anyway on the off chance that you (with your expertise in the subject) will find it easy / will have spent two weeks on it and have an answer ready
- they think the question is easy, because they have less familiarity than you with the problem (explaining why the question is hard is a good answer)
- they want to "test your mettle" (see: "opinion of you as a potential collaborator, postdoc, or fellow scientist")
- they want to show (to you? the audience? themselves?) that a defense is serious business (even if everyone knows the degree will be awarded at the end)
- they view the defense as a rite of passage and see hard questions as part of the ritual (if this sounds like hazing, that is because it is)
- they like exercizing their power at the expense of junior researchers, and asking tough questions is a socially-acceptable way to do so
(Not all of those are good reasons, but they are reasons.)
Notice that "check if the student knows his coursebook" is absent. A defense is not an examination in the usual sense; the examinee knows more about the subject that the examiners. If (as Buffy’s horror story has it) you are asked about something that would be taught in an undergraduate class, the most likely hypothesis is that you made a typo in a formula somewhere; the second most likely hypothesis is that the examiner is going to teach this class next year and they want to see how you would present the topic. (It happened to me - the examiner used slightly different hypotheses as I did for a certain calculation, and wanted to see how it affected the results.)
Another anecdote from my own defense about reason #3: another examiner asked a question that clearly would have required tons of work to answer (and I had not even started any of this work, nor implied anywhere in my manuscript than I had). I gave a diplomatic answer ("One would need to perform experiments X, Y and Z to know this") during the defense, but asked about the question in the post-defense lunch. He said "yeah, I agree, it seems like a couple of years work - which is why I asked you, because I hoped you might have a shortcut".
Finally, hard questions can be the sign of a defense going well! If I think your work is shoddy and uninteresting, I might cook up one or two basic questions to save face (having an examiner ask no questions is a bad look). If I am deeply interested in what you did and foresee multiple extensions, or I expect some of my own research to intersect with it, I am going to ask deep questions - the world-leading expert on the subject is right there, I would be foolish not to ask now.
External examiners
I neglected to mention rules about jury composition so far. There are lots of them, but for the sake of this question the most important is this: the jury must include at least half of external members. The definition of "external" varies across the country, but typically it would be: not in the same university and no co-authored papers with the PhD student.
The forced inclusion of external members is a conflict-of-interest rule. An examiner from the same research group as your advisor might feel obliged to let a student graduate with shoddy work, because it is politically easier than picking a fight with a close colleague. An examiner from the other side of the country will feel less pressure.
Another advantage of external examiners is exposure. A PhD defense is a research seminar where you have an usually long presentation slot, a very deep understanding of the material and lots of preparation time, plus a better-than-usual chance to chat with the audience afterwards. That is literally the best moment to shine of your entire research career. Why would you use it with a bunch of department faculty who have seen you five times in the department seminar anyway?
In the context of a largely non-adversarial defense, internal examiners are chosen for convenience - they do not have to take the train and they have more social pressure to be on their colleague’s committee. (Some researchers enjoy thesis defenses, some find it a chore, some have mixed feelings; but filling a committee is usually a pain so it is easier to do with people you know closely.)
The question at hand
(Finally!)
The aforementioned advantages are, in my opinion, compelling arguments to include her. In addition, whatever personal animosity exists between you would probably be exacerbated by "snubbing" her if she is a natural fit for your jury.
The potential downsides are in my view rather weak:
- she might sway the jury into failing you - only possible if your work is on the shoddy side, which your advisor should realize, and they would not be letting you pick your committee if that was the case
- she might ask genuine questions that expose weaknesses of your work. Well, that is the job of any examiner. Furthermore, having her ask those questions out in the open gives you an opportunity to answer, which you would not have if she just gave her offhand opinion to a colleague during a coffee break.
- she might ask aggressive questions to derail the defense. This will reflect badly on her, not you (assuming you stay calm etc. - but that could come from any examiner).
Final warning
I must reiterate that this answer comes from the perspective of a culture where the vibe of a PhD defense is "extended seminar talk" rather than "actual school exam with the possibility of failure".