Churchill, at the invitation of the King, had led a Coalition Government during the war. In the election after the war (July 1945) the coalition or "National Government" split back into their party factions and the Conservatives lost overall control to the Labour Party thus the leader of the Labour Party replaced Churchill as Prime Minister.
In the election of 1949 the Conservatives won a majority and Churchill, as their leader, became PM again.
That is what happened ~ quite why people vote the way they do remains a mystery but in this case it was generally thought that although Churchill was a good leader in war, in peace people wanted something different ... that the Labour party appeared to offer. (How many more times are the electorate going to fall for that idea?)