Exactly. Distance is the only factor.
If you photograph two trees which are 100m apart and your camera is 100m away from the first tree, the first tree will be twice the size of the second (100m away vs 200m).
If you move much closer to the first tree to let's say 10m then the first tree will be more than a 11 times larger than the second tree (10m vs 110m).
And that's completely independent from what camera/lens combo you're using. Lens and camera just determine the framing, not the relationship between foreground and background.
Also if the focal length would make such a difference than pictures form smart phone cameras (with their 3mm or thereabout lens) would look extremely distorted and those from 8x10 large format cameras (with a 300mm normal lens) would look super flat. But they don't. They both look normal.
Last edited by d__b : 10-09-2019 at 14:34.
Reason: for clarity