A wine's year of harvest, or vintage, is relevant because weather conditions and other factors tend to vary from year to year, meaning that some people may prefer the flavor of a specific vineyard's wines more from one year than another. Vintage is not important simply because of matters of preference, though, because some vineyards may be known to have experienced a particularly bad harvest one year, making that wine less generally desirable and therefore sensible to avoid.
Even a notoriously good winemaker may experience a particularly bad year and produce a bad vintage. On the other hand, weather conditions can be absolutely perfect one year, producing a crop of excellent grapes, meaning that that vintage is generally considered to have an outstanding flavor. This can translate to higher prices for a particular vintage, which is of concern for those who collect or invest in wine.
Weather isn't the only factor in determining a good vintage. Winemakers can use various tricks and techniques to improve the flavor of wine produced from a bad or unideal harvest. These vintages may be interesting to wine collectors and connoisseurs for that reason.
Vintage isn't a concern for all wines. Sparkling wines, for example, are usually considered "non-vintage" wines because they may be made with grapes harvested across multiple years.