When a colony is first allowed to elect its own government the head of the government is called the Chief Minister. As the colony gets more able to rule itself it is given more powers and the title of the Chief Minister is changed to Premier. When the colony becomes independent the Premier becomes a Prime Minister, and British government ministers lose any authority to rule the new country.
The leader of the federal governments in Australia and Canada is called the prime minister, but the leader of the governments in Australian States and Canadian Provinces is called the Premier. This is because the states and provinces are not independent.