By the 1860s, Great Britain became really concerned that Canada was more of a shining star than an asset to the Empire. British politicians did not like the expense of providing for the defence of the North American colonies from real or perceived threats from the Americans. The American Civil War only heightened fears in Canada of a potential invasion.
Americans, on the other hand, always seemed to have a group of people willing to go to war with Britain and invade British North America, often in high places (for example, Lincoln's Secretary of State, Seward). Britain's trade with the United States at this time had simply become too valuable to jeopardize by maintaining a colonial system in British North America, so prominent British politicians began the process of pushing Canada "out of the nest," so to speak.
However, the process was not simple. British North America consisted of no less than seven colonies, and the vast territory of Rupert's Land owned and run by Hudson's Bay Company. Uniting this area would prove to be difficult.
--- The following passage is inaccurate -- Confederation was achieved for many reasons. Canada West and Canada East felt that uniting the colonies would help make all of the colonies stronger, more economically stable, and would make the government system more fair. The maritimes, who were having a boom period, were disinclined to join confederation. They wanted to join together the maritime colonies and have a separate country for only them, however, the Americans had just finished the Civil War, and had about as many soldiers as all the colonies that were thinking about confederation did combined, and posed a real threat to the colonies. The maritimes thought about it, and with the help of a conference with John A. Macdonald decided to join confederation. The only maritime colonies that didn't join were Newfoundland and Prince Edward Island, which would join later on. At the Quebec conference, representatives from all the participating colonies came together and constructed the 72 Resolutions which outlined all of the laws that the new country Canada would have.