A (no) confidence vote only within the governing party is kind of weird in my opinion. It should have taken place in the entire parliament, just as it is the case in other countries with a parliamentary system of government. Ergo, if 140 Tory MPs don't have confidence in Johnson plus the entire opposition, he no longer has the support from a majority of the legislative.
It’d be too difficult to arrive at another leader if that was the system. Hard to imagine anyone would get a majority of parliament at the moment. Such a system would essentially enable fringe elements of the majority party to prevent governance. Imagine it in the US, where the Dem narrow majority relies on Squad members. I think the Squad might vote NC in Biden, along with every Republican. And then it’d be near impossible for the Democratic coalition to arrive at a completely unifying candidate.
The way it is allows another leader to be installed by the party which won a term in government, because the party was elected to government, while BoJo wasn’t and was only chosen by the Conservative party itself.