the subset construction
How do you turn a guessing machine into one that never guesses? The trick is to track, deterministically, the SET of all states the NFA could possibly be in after reading what it has read so far. That set is a single, well-defined thing, and it updates predictably. The subset construction is the recipe that makes each such set into one state of a brand-new DFA — hence the name: a DFA state IS a set of NFA states.
Here is the mechanism, in plain steps. Start with the start state of the DFA being the epsilon-closure of the NFA's start state (the set of states reachable for free at the beginning). For a DFA state S (a set of NFA states) and an input symbol a, the new DFA transition goes to the set T = the epsilon-closure of the union of δ(q, a) over all q in S — that is, gather everywhere any member of S could go on a, then close under epsilon-moves. A DFA state S is an accept state exactly when S contains at least one accept state of the NFA. Build only the sets you actually reach from the start, and you get a DFA recognizing the very same language.
This construction is the engine behind the equivalence of NFAs and DFAs, and it explains every part of the theory at once: branching becomes "the set could grow," a dead path becomes "that state just is not in the set," and epsilon-moves are handled by closing each set under epsilon. The price is size: the new DFA could in principle have one state per subset of the NFA's states, up to 2^n of them — the exponential blowup. In practice most of those subsets are unreachable and never built, so the determinized DFA is usually far smaller than the worst case.
Determinize the "ends in ab" NFA (states q0,q1,q2; q2 accept). Start = {q0}. On a: {q0,q1}; on b from {q0}: {q0}. From {q0,q1} on b: {q0,q2} (accept, since it holds q2); on a: {q0,q1}. From {q0,q2} on a: {q0,q1}; on b: {q0}. The reachable subsets {q0}, {q0,q1}, {q0,q2} are the DFA's three states — far fewer than the 8 subsets in principle possible.
Each DFA state is a reachable SET of NFA states; only reachable subsets are ever built.
Build only the subsets reachable from the start set, not all 2^n. The 2^n figure is the worst case, not the typical result.