Mike Bostock’s page has my favorite explanation of how enter() and exit() work.