There's always more to be said, but in the meantime you can find some answers in this thread by u/aguafr3sca and u/Starwarsnerd222 about the 1931 Statute of Westminster, which granted the sovereign Dominions full legislative independence from British Parliament. There is also info about the lingering imperial connection these dominions had with Britain even after nationhood.
Some context is in order. In 1867, the British North America Act made the colonies of Canada into an independent dominion, but with a strong connection to Great Britain. It still had foreign affairs and defence ties with Britain -- this is seen in the 1880's when Britain dispatched warships to British Columbia's coast upon completion of the Canadian Pacific railway to counter the potential risk of Fenian raids from the US.
English Canada embraced the greater imperial connection to Britain and it formed an influential part of anglophone Canadian identity in the 19th century. Canada participated in the Boer War due to this patriotic desire to serve king and empire. French Canada did not share this view and frequently opposed imperial adventures, a source of tension between English and French into the early 20th century.
The imperial allure continued to the outbreak of WWI, when Canada joined out of duty to the mother country. But the blood shed in the battlefields of Flanders and France would be Canada's crucible of fire. It became increasingly independent and sought command of its own troops in the field, separate from the British Army. Canada would later insist on signing the peace treaty as a nation in its own right. Canada's entry in WWII was also motivated by an imperial duty to defend the empire, but this time Canada declared war independently of Britain.
The thread above describes the Statute of Westminster, which granted legislative independence to the "white" Dominions, including Canada. But there were still anachronistic legal leftovers of Britain's colonial legacy. The 1867 BNA Act was a British law, which meant that Canada's constitution was still in Britain. Britain still had the power to amend Canada's constitution. It was still technically possible for a Canadian to make appeals to the UK House of Lords, if someone wanted to contest higher court rulings in Canada, for example.
Canadian PM Pierre Trudeau's government, having won the 1980 election, began a long, arduous process to patriate Canada's constitution from Britain and close/sever any lingering loopholes. The process caused tension among the provinces, esp. in Quebec (which had a separatist government then).
The Queen arrived in Canada in 1982 to personally sign the Constitution Act into law. The UK Parliament had to simultaneously pass a law, the Canada Act, allowing the patriation to happen and ending the ability of Britain to amend the Canadian Constitution.
So it was a long, sometimes rocky, evolution from Confederation and Dominion status in 1867 to Canada's constitution returning home in 1982.