I'm not a carpenter, but I've done a lot of carpentry work for myself, relatives, and volunteer projects. I have also set a lot of posts in the process of building miles of barbed-wire fence, building barns and such.
So, in my experience the things that make posts lean are continuously saturated ground, heavy equipment running too close to the posts, posts not set deep enough in the ground, and poor compaction of the fill around the base of the posts. The first three causes, saturated ground, tractor mowers and posts not set deep enough are what led to me having to straighten up a leaning board fence earlier this year.
The rule of thumb for setting posts is that one-third of their length should be in the ground. This assumes that concrete is not poured around the base of the post. Concrete bonds well enough to a post so that it acts mechanically as part of it, so it adds weight and creates a wider base that resists overturning. So for an eight-foot-tall cross set in earth, you'd need a twelve-foot long timber with four feet set in the ground.
Compacting the fill around the base of the post is important, too. If voids are left, then there's a chance the post will lean. I've always done compacting around fence posts, barn posts, etc. using the end of a shovel handle or a piece of pipe. It's best done with something narrow enough to enable you to concentrate force on small areas of the fill at a time, so you can poke the dirt into the voids and close them up.
All of this is common-sense stuff that ancient peoples no doubt knew as well as builders do today. This also assumes that you are setting a post that you intend to stay in place for a long time.
Jedakk