Vaughn Palmer: In 18 months, the Conservative party had come from nowhere to drive an incumbent government to the brink of defeat