Fresh spices vs Dried spices
Spices are generally comprised of bark, buds, fruit, seeds or stems of plants.  They are almost always dried.  Garlic is not a spice, rather, it is a vegetable, like onions or shallots.  You can, of course, get dried garlic, onions, or shallot.  But the drying process does not make it a spice.  While spices have a fairly long shelf life, they should be used when fresh.  Purchasing whole spices and grinding them yourself increases the shelf life, as ground spices, with more surface area, lose freshness more quickly.