Basically, fruit and vegetable processing works like this. When canning, you expose foods to a lot of heat. When freezing, you expose them to a short burst of heat and then you cool them. When it comes to fresh, you don't heat them at all (although you can chill them). Then the food -- whatever its end form -- gets transported to where a customer can buy it.
When you heat food (and this includes cooking it), you destroy or at least slow down the bacteria and enzymes that contribute to spoiling and decay. Freezing food does the same thing. These actions decrease the levels of some nutrients, but in rare instances, also simultaneously increase the levels of others. Take tomatoes, for example. When you heat tomatoes, you amp up levels of lycopene (a great antioxidant) but in the process you sacrifice some vitamin C.
Processing also stops moisture loss and interaction with oxygen. And while there are a few other elements that could be at work (for instance, canning can involve adding additional ingredients like sodium, sugar and water that may affect nutrient levels), for our purposes, let's just focus on the main differences.
Another factor in the overall equation is when the product is harvested. Fresh produce is typically picked before it's ripe, so unlike frozen or canned products, it often doesn't come with a full load of nutrients from the get-go. What nutrients the produce does have will start to diminish over time. Even if it looks fresh, a premium appearance can be deceiving. Generally, freezing and canning slow nutrient loss.
What you have then, is a balancing act. Canned and frozen food might be somewhat depleted during processing, but once that initial loss is over, they can start to make gains on fresh food. This means that a 6-month-old can sitting on the shelf could be healthier for you than its fresh compadre over in produce, languishing for weeks waiting to catch a customer's eye.
If you eat all your fruits and vegetables directly upon picking them at peak ripeness, then you're in great shape; but obviously, most people don't have that kind of year-round access to a wide range of produce.
So does all this send you on a slippery slope straight to the bottom of the food pyramid? It doesn't have to -- cover all your bases and try to get a good mix of canned, frozen and fresh fruits and veggies the next time you hit the grocery store. If you eat the recommended five to nine, sooner or later you'll probably stumble across everything you need.