What happened
May's deal was the result of nearly two years of painful negotiation. It secured a transition period, protected EU citizens' rights, and included a Northern Ireland backstop — a guarantee that the Irish border would remain open regardless of the outcome of future trade negotiations.
The ERG (European Research Group), led by Jacob Rees-Mogg and including Boris Johnson and Priti Patel, voted against it because they objected to the backstop, which they said could keep the UK tied to EU rules indefinitely. They claimed they could negotiate a better deal. When Johnson became PM and 'got Brexit done', his deal actually kept Northern Ireland in the EU's single market for goods — a substantially more permanent arrangement than May's backstop, which the ERG had claimed was unacceptable.
The three defeats set records. The 230-vote defeat on 15 January 2019 was the largest defeat for a sitting government in the history of the British Parliament. The political chaos of this period — three meaningful votes, two extensions of Article 50, the longest Parliament in modern history unable to agree on anything — was the direct consequence of a party that had spent 30 years fighting about Europe without ever having to agree what it actually wanted instead.