Wood in posts submerged underwater will not decay because there is no oxygen. But wood in posts that have both water and oxygen will decay. Problem with many treated posts is that the heartwood does not take treatment, so many posts are only surface treated (the sapwood takes the treatment, and the heartwood just has to survive on some natural resistance to decay).
Posts in concrete will decay faster than those not in concrete.
Groundline decay is usually what happens first. Above and below that groundline area will last longer, but the weakest link is at the groundline. Posts in a pole shed usually are drier because they are under roof and likely in ground that is well drained (animal barns may be an exception to this).
Posts in water will decay fastest at the water line, where there is both oxygen and water. Wood can be protected from decay by submerging it in water. In coastal areas, there are marine borers (toredos) that will bore into wood and destroy it, something like termites, and again mostly at the line between high and low tide. The borers don't survive in fresh water.
There are all kinds of ideas on how to do it the best. Some like concrete and will do it that way. Getting a rotten decayed post out of concrete is not fun, because the decay is right there where you want it to hold together. /forums/images/graemlins/wink.gif