Casks are able to produce items with "iridium star" quality. Iridium star is the highest level of quality, which doubles the value of an item. Different types of items take longer or slower to age. Wine takes the longest -- 2 seasons of aging to go from basic wine to iridium quality wine.
Several hours after the item in the cask reaches Iridium star quality, it can be collected from the cask normally. The cask will then immediately begin to produce the same item, starting at normal (non-star) quality. A pickaxe can be used to stop production at any point by removing the item from the cask altogether (this can be done at any stage of fermentation).
Casks can be placed anywhere, however they will only accept goods to refine if they are actually in the cellar.