If you have ever tried a beer on tap at a bar, then bought a six-pack of it later, you might think it tasted different. It probably does, for a number of reasons that we will explore here. There are some breweries who have a slightly different recipe for their bottled beer than their draught, so you may have noticed an intentional difference
Beer from the tap is usually fresher than the bottled or canned product, and freshness impacts flavour. Its ingredients are usually prone to oxidisation, which can also impact its flavour. Hops, a crucial ingredient in beer, is highly prone to oxidisation, so the oxygen can degrade the flavour easily, and it is an ongoing process, so it will keep oxidising the keg once it has made its way in. This will make much older beer horrible.
When beer is bottled, it undergoes pasteurisation, which means it is heated to kill off any bacteria; this can also impact your beer’s flavour. Heat is an enemy of beer, flavour-wise. It needs a cooler environment, and heating it up to pasteurise it, can significantly change the flavour.
Some bars will add something called beer gas or nitro, which is a mixture of carbon dioxide ad nitrogen to attempt to smooth out the flavour of the beer, but this can alter the flavour enough to where it can taste significantly different to a bottle or a can, this is mostly in stouts, like Guinness.
As long as you keep your tap lines clean, your draught beer is generally going to be better than a bottle or can. However, some beers, like barley wines and Belgian beers, will taste better after they have been aged, so there is a distinct possibility that it might be better in the bottle.
When beer is in a bottle, it is subject to light, which is not something that beer reacts well to. If it is kept in light, it will begin to turn bitter on its own. Brown glass is used to mitigate the damage to light exposure, but it will still have problems if it is subjected to light in the longer-term; sitting on the brightly lit bottlestore shelves is a good example of bottles being in light for too long.
Bottled beer can slowly leak out the carbonation, letting the air in to mess with your flavour.
The big commercial beers are usually in cans, so many people will avoid them as a matter of principle. Some expect beer from a can to have that mass-market, uniform, cheap taste to it, so they do not even want to go near a can. However, cans have been known to be much better for beer storage than bottles.
Cans can keep the flavour stable for longer, because it is hermetically sealed, so nothing can go in or out. They also let in no light, which keeps the beer happy and in the dark. If you cannot get a beer off the tap, getting it canned is the best way to go; canned beer is generally much better than bottled.