This is why it's important to have a secondary source of income (most likely a business) and money in the bank.
If I'm required to work past 5 for too long (once in awhile, it's fine), I find work elsewhere.
Yeah, the balance aspect is pretty key on both sides. I generally put in 7-8 hours in the office, plus perhaps an hour or so in the morning before the rest of my family is awake (though I may not always work this hour). I've been with the same employer for over five years, and there have been times that I've been asked to work a bit extra (though, typically, I've been able to leave at 5, and work later in the evening, after the kids are in bed). And, of course, there have been times I've been given a great deal of flexibility in my work schedule to accommodate emergencies.
Of course, this isn't typical, perhaps even in tech, and I feel rather fortunate to have this situation.
It's worked pretty well so far.