For most of the twentieth century, cans were the cheap format and bottles were the serious one. That has reversed comprehensively, and the technical case for cans is now strong enough that most new breweries package in them by default.
Light
The clearest advantage. Beer exposed to light develops a fault called lightstrike, caused by hop compounds breaking down under ultraviolet and blue wavelengths, producing a smell usually described as skunky.
It happens fast. A clear bottle in direct sun can be affected within minutes, and shop lighting does the same over days and weeks.
Brown glass blocks most of the damaging wavelengths, green glass considerably less, and clear glass essentially none. A can blocks all of it, permanently.
For hoppy beer, where the compounds involved are present in quantity, this is decisive.
Oxygen
Oxygen is what stales beer, producing wet cardboard flavours and destroying hop aroma. Modern canning lines purge the container with carbon dioxide before filling and seal with very little headspace.
A can's seam is a complete barrier. A crown cap on a bottle relies on a liner that permits a small amount of oxygen ingress over time, and while the quantity is tiny it accumulates over months.
For beer intended to be drunk fresh, which is most beer, the can holds its condition longer.
Practical advantages
Cans are lighter, which reduces transport costs and emissions. They chill faster, stack better, do not break, and are permitted in places glass is not.
Aluminium recycling is highly efficient and the material is recycled repeatedly, which is a genuine environmental argument rather than a marketing one.
Mobile canning services made small-scale canning viable for breweries that could never justify their own line, which is a large part of why the format spread through craft brewing so quickly.
The metallic taste question
Beer does not touch aluminium. Cans are lined internally with a polymer coating, and the liquid contacts that rather than the metal.
Any metallic impression usually comes from drinking directly from the can, where the metal touches your lips and your nose is inside the opening. Pouring into a glass removes it entirely.
It also removes a larger problem, which is that drinking from a can delivers almost no aroma. For a beer bought for its smell, that is a substantial waste.
Where bottles still make sense
Bottle conditioning is the strongest case. Beers refermented in the package, including many Belgian ales and traditional strong beers, are conventionally bottled, and the format handles the pressure and the sediment well.
Corked and caged bottles are used for gueuze and strong Belgian beers where pressure is high, and the format allows for large formats intended for sharing and ageing.
Long-term cellaring is generally done in bottles, partly by convention and partly because the format has a longer track record.
And there is aesthetics, which is not nothing. A corked bottle on a table for sharing carries an occasion that a can does not.
What to do
For anything hoppy, fresh or pale, buy cans without hesitation. For strong bottle-conditioned beers intended to be kept, bottles are fine and often the only option.
Whatever the format, pour it into a glass. That single habit does more for the beer than the packaging argument does, and it applies equally to both.
What about cask and keg
Draught formats sit outside the comparison and beat both for freshness when handled properly.
Cask ale is unfiltered, unpasteurised and finishes its conditioning in the container it is served from, giving a softer texture and a shorter life measured in days once opened. Keg beer is sealed under pressure with no air contact, which gives consistency and a longer life.
Neither travels home, which is the practical limitation. For drinking in a pub, draught is generally the better proposition; for drinking at home, cans are the sensible default and the argument about bottles is mostly settled.