Canada's road to nationhood was part of a general 19th century trend toward the creation of nation states. Aside from England and France which had long been distinct countries, most of Europe was made up of small states and districts. The German states weathered revolutions in 1848 to grow under Bismarck into a united Germany in 1871 and Italy gradually became unified during these years, too, while Austria and Hungary were also forming countries out of the old Austrian Empire.
Even the United States battled through a civil war to consolidate itself as a unified nation. In Canada we managed to unite without gunfire, but many of the same factors fostering nationhood elsewhere applied here. Improvements in transportation and communication, like the railway, the steamship and the telegraph, meant that people could exchange information easier, ship their goods to a wider market and move themselves within a larger world.
The railway was particularly important in Canada's development and many of the people who promoted railway expansion were supporters of Confederation.
The railways opened up the country and linked its parts, but they were built primarily to transport goods within an economy that was changing, growing away from its old reliance on fish, furs, timber and agriculture - raw materials which the Montreal mercantilists exported to Great Britain in exchange for manufactured goods. Canada was beginning to produce manufactured goods of its own and the new industrialists wanted to be able to supply their home market, transporting their goods across British North America easily and without tariffs. Another big incentive for Confederation was a fear of annexation by the United States which was kindled by the War of 1812 and kept alive by various border disputes, the Fenian raids and vigorous population growth and westward expansion by the Americans.
Although the average homesteader in Canada West, or the fisherman in Nova Scotia might not care one way or the other about federal union, the political movers and shakers and their industrialist friends had a vision which they hoped would help business and prosperity while, not incidentally, creating a new nation.