When we think of fence posts, we are usually thinking of either 75 x 75mm or 100 x 100mm posts that you see in builders merchants or garden centres, probably green or brown in colour. These posts are generally called softwood and have been pressure treated to make them last longer in the ground. The best industry standard at the moment is to use HC4 treated timber which means that the wood has been dried before treatment, which allows the preservative to fully penetrate the wood. The next thing to consider is species. 'Red wood' species such as pine, larch or douglas-fir perform better below ground than 'white wood' species such as spruce and accept the treatment process more readily.
The chemicals that are currently being used to preserve timber have to conform to EU legislation and have not been around that long, which makes it almost impossible to say how long a post will last.
If you are considering pressure-treated round stakes or paddock fencing, the most durable are pressure creosoted and can be used in an agricultural environment but not domestic one.