Beer tastes bad when it goes bad, yeast is really good at protecting itself - there's nothing in beer that anything can eat without oxygen so nothing can reproduce, most things can't survive the alcohol.
Beer in commercial places doesn't have time to go bad they empty multiple kegs a week, a keg typically holds about 100 pints
My homebrew setup uses kegs that hold about 35 pints and they don't empty quicker than in a season, some of my beers are on tap for a year or more. Beer life is limited by oxygen penetration and temperature.
If it's exposed to air it goes bad in days to weeks depending on temperature but it goes bad by the yeast converting it to vinegar, and that very quickly tastes bad, even very drunk people tip out rather than drink an even slightly oxidised beer