Contrary to what you might think, coffee isn't a shelf-stable product -- it doesn't stay fresh indefinitely. If your coffee shop isn't grinding its coffee fresh on a daily (or even hourly) basis, chances are you're drinking some stale coffee, which means diminished flavor.
The roasting process is what releases the oils in the coffee bean and gives you the deep, rich coffee taste. Coffee beans reach their peak one to three days after roasting, and then the flavor starts to deteriorate. Fresh-roasted coffee should be used within a week, or 10 days at the most. A good barista will grind beans as needed. Once you grind those beans, you're opening up the coffee to go stale. Coffee beans and ground coffee should be stored in a dark, cool, dry place and never in the fridge or freezer.