My UK undergraduate degree was assessed solely on "final examinations" at the end of 3 years (and again for the 4th master's year). So for my degree the principle was that for a particular couple of weeks one summer, it was necessary to be able to prove at the drop of a hat all the theorems on the syllabus in all topics examined, and to be able to complete any exercise similar to those in the textbooks. Other degrees are run on different principles as to what's required of you by others (as opposed to what you require of yourself).
In fact, to be strictly accurate, since I was expected to choose about half the exam questions to answer, it was possible to neglect some areas and still have mastered it sufficiently for a good honours degree. For other purposes, though, "sufficient" would be different. If you just want to complete your degree comfortably, then your needs are different from if you want to do research in a field, or if you want to teach undergraduates.
I didn't do a graduate degree, but I believe that at the time I completed my undergraduate master's degree I was reasonably well prepared for one. I could and did prove the theorems (unless I forgot to address a detail and gave a flawed or incomplete proof, which I think is inevitable when working at speed, but examiners understand that and give you nearly full marks for a nearly-complete proof marred by time constraints). I could solve more than half the problems on offer (the longer I stuck at it, the higher proportion I could solve, it's not as if I completed every problem set perfectly).
Senior faculty don't leap out at junior faculty in the corridor and demand that they instantly deliver a complete elementary proof of Stokes' Theorem, but any faculty in a relevant field would be familiar enough with all the techniques involved to describe the shape of a proof straight away and fill in the details given time and paper. Whether it's better in a given situation for a professor to produce such a proof or look one up depends on the context. And from time to time, students will demand any arbitrary details of the topic, and teaching faculty who are on top of the material can deliver it more often than not. If not then they still know where to look it up.
If so, is this due to brute memorization, or simply mathematical maturity?
Definitely maturity. Memorizing a proof line by line is almost useless except perhaps as a relatively inefficient means of passing an exam. Most undergraduate proofs contain a small number of crucial points that one memorizes (or actually I'd say "learns" -- memorize might suggest just reproducing a string of letters onto the page, and that's not the best way to recall it). Learn them alongside the statement of the theorem itself. The rest of the proof is just cleaning up, and with experience is easy enough to fill in each time. So for an easy example, you might learn an elementary proof of Lagrange's Theorem in group theory as "cosets partition the group". Once that phrase allows you to write a complete proof the theorem, there's a sense in which you've mastered that one proof. So, as a first-year undergraduate I would write down that theorem, write down the gadget that I knew would prove it (i.e. define the left cosets of the subgroup in the group), and the rest of the proof is picking off the survivors.
Anecdotally, a friend who was doing his PhD while I was an undergraduate, wrote his entire undergraduate revision notes on an A1 sheet of paper and stuck it on his wall. So even if he'd rote memorized the notes (and I'm not sure even that is true), that's 8 sides of A4 covering two years' full-time study. He always said his memory was really bad, and therefore he needed to do without memorizing anything much. Understanding the material was sufficient.
At an undergraduate level, I think if a proof requires more than 2 or 3 clever gadgets of its own, then something has gone wrong, that you can address as you're studying the material. There should be some lemma that you can learn as a theorem in itself with its own proof, and then learn how to show that the big theorem is a consequence of the lemma. The reason for this is that the theorems on an undergraduate syllabus are old and well-studied, the proofs you see have been polished, and the most valuable intermediate results in the proof have been identified and separated out. Whoever proved the theorem first might have had a very different proof, or might have had "essentially the same proof" in different terminology and via a path with no signposts, but since then civilization has arrived.
In any case I think that unless you're planning to leave after your undergraduate degree (and maybe not even then), it doesn't really make sense to worry about whether you've "mastered" undergraduate analysis. The line between undergraduate analysis and further analysis is fairly arbitrary, and it's never the goal of a professional mathematician to completely comprehend a topic up to a certain level but know basically nothing about it beyond that. So if you go on, then you've "mastered" undergraduate analysis when you have a good enough grasp of "postgraduate analysis", that all of undergraduate analysis becomes basic background information to your "real knowledge". This is where the process of re-visiting and re-learning occurs, that others describe. Except perhaps for exceptional individuals, an undergraduate won't "master" any undergraduate topic to this level. Applicants for graduate programs will be expected to be able to do undergraduate mathematics and do it well, but mastery is another matter.
It certainly doesn't follow that you can always complete every exercise in the book: I've seen extremely talented and experienced mathematicians, whose research work and teaching proves that they've "mastered" the elementary parts of a field by any sensible definition, be stumped by an undergraduate problem that they've no doubt seen and solved before, just because they happen to overlook the correct approach. On another day they'd solve it instantly.
[Come to think if it, I suspect I might have seen full Professors at Oxford University briefly stumped by problems they set themselves the previous week. No particular incident comes to mind, but it's the kind of thing that can happen in fourth year classes. Mastery is only ever as good as the day you're having...]