The reason for staking a newly planted tree is to stabilise the roots while it
sends out it's new roots into the surrounding soil. New roots are extremely
brittle so if the base of the tree rocks or blows around it will snap off the
new roots and the tree will not establish.

The top of the tree should not be staked. All the evidence is that the flexing
of the trunk in the wind actually helps it strengthen, so short stakes are
much better than tall ones.

Bare-root trees are usually staked vertically - dig the hole, drive in the
stake at least 10cm, then plant the tree to the stake. Once the tree has been thoroughly
firmed, finally fix the tie around 2cm / 1in below the top of the stake.

Container-grown trees often need no staking - the "lump" of solid root-ball
once firmed in the surrounding soil often provides sufficient stability to
enable the new roots to grow without risk. Local factors such as soil type
and position - exposure to / shelter from strong winds - are most important,
as is the degree of establishment of the roots in the compost.
The rule should be: If in doubt, stake it!

If a container-grown tree does need staking, it is often easier to drive the stake in
across the middle of the hole, then plant the tree, firm it well,
finally fix the tie where tree and stake cross. The stake should point into
the prevailing wind
(i.e in the direction from which the prevailing wind