According to British law, scotch must be aged in oak barrels for three years. Typically these are sherry or bourbon barrels. Historically when barrels were shipped from Spain to England to England distilleries would purchase the empty barrels to be re-used because they were cheaper than buying new ones and to add flavor. Interestingly sherry and bourbon are normally made from American oak. That's right, barrels are made made with American wood, shipped to Spain, used for sherry, and sent to England for scotch. The barrels used for bourbon can only be used once by law, so there is a large amount of the available and with the demise of the sherry market and increased scarcity of sherry barrels bourbon has become more important. Now bourbon is just American whiskey, so it is interesting that scotch almost exclusively re-uses barrels where bourbon will not. These barrels are typically charred before use to allow the oak to mix with the bourbon. Typically scotch will use the same barrels twice before they are discarded since the bourbon or sherry flavors are gone. That means that if the bourbon was matured for 6 years and two scotch batches were made then the barrel could very well have been used for 30 years or more.
Another difference between sherry and bourbon barrels is the size of the barrels. Sherry barrels are called butts and are 500 liters. Bourbon is typically made in 200 liter barrels that are taken a part and reassembled with a larger barrel end, or head, and made into a 200 liter barrel called a hogshead. Laphroig has created quarter cask bottlings, which are the size of barrels used a 100 years ago when the entire barrel was transported for delivery. Lagavulin's Distillers edition finishes the maturation in Pedro Ximenez barrels for a year. Pedro Ximenez is a type of white wine made in Spain.
Barrels have a significant influence on the taste of scotch. I hope that this entry helped educate you about them. Much of this information comes from Michael Jackson's excellent Complete Guide to Single Malt Scotch and would be a good place if you are wanting to learn more. It will be interesting if with the changes in the industry if changes will occur to the barrels used in production.