Many factors :
- If you have lots of jungle, iron working makes more sense.
- If your civ starts with some prerequisites, horseback riding makes more sense.
- If you're more of a gambler (higher risks since the tech costs more, but higher reward since swordsmen are better), go for iron working.
- If you're playing against Greece (phalanx), don't go for horse archers.
- If you're playing against Romans (praetorians), don't go for horse archers. Axemen are the only thing that can stand up against them.
- If there's no possibility of expansion, go for archery to survive barbarian axemen. Don't expect archers (or even skirmishers) to let you take out civs at higher levels, but at least they'll help you survive.
- If you play Romans (praetorians), go for iron working. If you play a civ that has an early mounted UU, go for horseback riding.
There may be more that i forgot as i typed this.