The last Prime Minister who was voted in only by national election was David Cameron in 2010. How is this different from how Liz Truss became Prime Minister?

PLEASE ANSWER QUICKLY!