The title of this question is fairly self-explanatory. I am developing a fantasy world, and I want to know what factors determine what kinds of trees I can have, where I can put them, and why.
I want to know what factors (climate, habitat, weather, etc.) will tell me which trees can exist in a given area. For example, maybe a certain type of tree can't exist on a forested mountain. Or in a swamp. Or on the coast.
I want to know what kind of soil I need. I don't need anything too technical, I just need to know if the soil is swampy, rocky, salty (as in from an ocean or something), etc.
And of course, I would like to know the reasoning behind your answers.
EDIT: In order to make this question less broad, and clear up some possible confusion: I am talking about real trees. I do not need need to know the specific kind of trees - if all of the trees in a broad category arise from the same factors, then just use that category. You could also describe the characteristics of the trees (eg, marshy ground usually gives rise to trees like this), maybe with a few examples. This would enable me to make my own trees, which is always more fun anyway. :)
I'm basically trying to make sure I don't put a tree somewhere it isn't supposed to be.