There are a few instances of "independence" which you could be referring to: the British North America Act of 1867, the Statutes of Westminster in 1931, and the Canada Act of 1982.
In all cases, the short answer is that in the case of the British North America Act, it was the divestment of responsibility from the Parliament at Westminster to a local responsible government via a unified parliament for the colonies of British North America (upper and lower Canada, Nova Scotia and new brunswick).
There had already been internal (1837 rebellions, political deadlock within the Canadian legislature between the french and English factions) and external (Britain's lack of will to defend colonial holdings, loss of trade agreement with the US because of direct colonial ties to Britain, repeated raids along the southern border from Irish nationalists/Fenians) pressures on the colonial governments which made self governance and seperation from direct rule very attractive to the future provinces. Additional push was given from Westminster after the repeated instances of Canadian issues continued to distract from more important matters or the French problem continued to pop up.
It is important to remember that each of the colonies in what is now Canada had some sort of local legislature, most notably in the province of Canada, the legislature there dating back to 1840. The continued divestment of power was not too much of a stretch.
The Statute of Westminster in 1931 was both common sense and a reward of sorts for the valient effort of the dominions during the Great War. Britain at this point needed to sort out their own issues, colonialism was becoming less cool, and the dominions (Canada included) were not overly pleased with Britain deciding on when they would or would not go to war. The proving ground of Vimy and other major battles showed that the Dominions were more than ready to deal with their own foreign policy, the signatures of Dominion officials on the Treaty of Versailles is the concrete proof of that. The statute more or less being a formality by the time it was signed into law.
With the statute, Canada shed the majority of its colonial ties save for two crucial elements: constitutional amendments and having an official original copy of the constitutional documents in the hands of the domestic government. Constitutional amendments are a tricky issue in Canada due to the constantly feuding groups (Anglos, French/Quebecois, indigenous tribes). Still to this day, amending the constitution is a major issue. The purpose of the Canada Act of 1982 was to make it so if there was any need to amend the constitution, the Canadian government did not have to petition Westminster, an odd issue in 1982 when the nation had been majority self ruling for 115 years. A main sticking point was the issue of Treaties signed between indigenous tribes and the Crown (a way to refer to the general state), previously looked at as direct agreements between sovereigns, being transferred to the local federal government and officials.
The patriation of the Canadian Constitutional Documents allowed for Canada to finally become a fully independent country in 1982.
TL;DR: Canadians and the British Parliament at Westminster were increasingly becoming annoyed with having to deal with one another, so a gradual distancing via divestment of powers took place over a period of 115+ years.
Can you be more specific are you asking why Canada obtained the right to self governance in 1867 or are you asking why Canada obtained almost-complete legal Independence from Britain in 1931?