There have been scientific studies for the past 20 years or so on maturation and what happens in the casks and, although they've found out a lot, they're still researching it. As far as wood it must, by law, be oak but there are huge differences in the types of oak that's used. Not just for flavour pickup but in the porosity of the wood for evaporation in the "angels" share, e.g. French oak, as used for cognac, has a far tighter grain that American White Oak which means that French oak normally doesn't have the same amount of evaporation as white oak.
Quality of the whisky maturation does, to a great extent, depend on how many times the cask is used. It's best to imagine that the wood is a reservoir of flavours and each time the cask is filled and takes flavour there's less left in the reservoir for the next filling, and once it's taken it can't be put back.