Why was Gordon Brown Prime Minister?

Gordon Brown was elected leader of the Labour party unopposed in 2007 after Tony Blair stepped-down. When Tony Blair resigned as Prime Minister, HM Queen Elizabeth II called for Gordon Brown, as leader of the majority party to form a government.