天 is sky while 下 is used to describe something being below. Sky is vast and infinite which cover the whole world, so 天下 means the whole world.
On the other hand, ancient Chinese think that China is the whole world, therefore天下 also means the territory of China.

Reference