「に」comes first to indicate 'place'. 「で」second.
Because 「で」is by its origin 「にて(=に+て)」
The sound of にて(nite) got broken into で(de)
「にて」is only a derivative of 「に」
「に」is more important and basic word.
we never say 東京で住んでいる but simply say 東京に住んでいる
but we say 東京で暮らす, 東京で生きる, rarely say '東京に暮らす'
「に」is where you are. (the point)
「にて」is broader, it's where you do, the place you act in. (the field).