Theresa May bowed out after nearly three years as prime minister on Friday, defeated by her inability to deliver Brexit.