They lose their "potency" as they age. As with most things, the cooler you store them the longer they last. I never throw away old spices even though "the experts" say to toss them after a few years. I just use more of it to get the flavor I want.

If you have a garden, grow some of your own spices! They are easy to grow and then I pick them and dry them in the sun. You can get a lot of cheap spice that way. This is the time of year you can buy them as small plants in the nursery. I grow chives, cilantro, basil, rosemary, parsley, oregano, etc. The basil and cilantro are the only ones I have to replant each year as the others are perennials.