The point is that they do not decide the Prime Minister, they decide a leader of the party. Who will automatically be APPOINTED Prime Minister as leader of the biggest party in the House of Commons that WE elected. There's nothing to stop anyone joining the party and having their say in this.
The Prime Minister is not elected and never has been. We elect the House of Commons, and who is Prime Minister falls out of that. The Queen appoints whoever is most likely to command a majority in the House and form a stable government. It generally ensures that the Prime Minister has enough support in the House to get things done.
In fact, until fairly recently, the party members didn't have a say. The MPs elected a leader from amongst themselves. As the MPs are the people the leader has to work with, it makes sense - they will elect someone they will support and be able to work with, at least most of the time. You may not think that is democracy but it is practical. Now, the MPs still elect the leader by exhaustive ballot up to the point of there being only two candidates left, and only THEN does the party membership get a vote. Remember last time in 2016 - one of the final two dropped out so party members never got a say at all.
Compare that with Labour, where the election is thrown open to the whole party membership and unions right at the start. That landed them with Jeremy Corbyn, who doesn't get on well with many of his own MPs. Look at how he was challenged only a year later and they had to hold the election again - with, inevitably, the same result. Having just the MPs choose a leader from amongst themselves has a practical advantage.
Democracy happened when we had a general election and voted the Tories to be the biggest party.