In the commercial world, I think it's primarily an issue of freshness. Kegged beer is brewed and shipped quickly (and cold) for virtually immediate consumption, while bottles/cans may sit in trucks, warehouses and stores for weeks or months. Bottles are also more prone to degradation from heat or UV exposure. Finally, most kegged beers (domestic anyhow) aren't pasteurized, while most bottled ones are.
In some cases though, I have to believe that there is more going on, and perhaps different recipes are used. I always enjoy Guinness on tap, but I've never had a canned or bottled variety that tastes anything at all like the draft product.