Manufacturer "best if used by dates" - how long that container has been on the store shelf
It probably hasn't been there very long, a few days to a few weeks at most. Shelf space in a grocery store is very valuable. They want to use it for products that move, not for inventory. Some vendors even have to pay a slotting fee to the stores to keep their products there. 

That's not to say it was made yesterday. It may have sat in a manufacturer's or distributor's warehouse for months. Again, they don't want to pay the costs of inventory, but the logistics of manufacturing sometimes mean that they have to make a lot of stuff at once and store it. That would be most obvious for something like seasonal fruits, such as cherries, which are harvested all at once, canned, and then kept in warehouses before being shipped to retailers.

I don't know how far they'd set the "best before" date for grated hard cheese. It probably varies from manufacturer to manufacturer. I wouldn't have anticipated it being much more than three months, but if you've got a jar with a three-month date then it was probably at least six. Which means it could well be three months old before you bought it.

But it probably spent little of that time taking up shelf space.