May remained this long because she didn't want to step down as a failure of a PM. Too bad for her that she didn't want to do the one thing that would have served the UK the most, that way she could have been remembered in a more positive way. But since she didn't want to do that one thing, she has no other option than getting out before embarrassing herself even more. The Brexit story will go through more extensions because on one side you have the UK who is aware how hard it is to work out good deals as a small island, and on the other side you have the EU who doesn't want to lose the UK because of its importance. Both parties have a strong interest in postponing the Brexit even if it makes them look ridiculous.
May should have greenlit a second referendum to serve the people of the UK. Another 'yes' for the Brexit would have meant that the problematic situation stays as it is (so nothing to lose), a 'no' would have resolved the whole thing.