I Believe that Theresa May called the 2017 General Election as Tory party thought they would "wipe out" the Labour party at the polls. They had good grounds for that thinking as the Conservative party had a twenty point lead in the opinion polls at that time.
However, in a campaign centred around Jeremy Corbyn, he turned out to be very good at the very many informal public meetings that were held, while the Tory campaign focused on very formal workplace meetings where all the staff had been sent home and invited party members attended.
In the above, May lost her majority in the House of Commons allowing the extreme right wing of the party to gain control. Hence the problems the country faces now.