In the ancient world, a city on a hill would have signified strength and protection. It was for the purpose of self-defense that cities were built on hills—it was easier to defend a city when attackers had to come up to you, than if you were in the middle of a wide open plain. It gave you a valuable tactical advantage.
For the first hearers of the Sermon on the Mount—his disciples—the phrase a “city on a hill” would likely have had a fairly specific connotation. Jerusalem. For a Jew, Jerusalem was the city on a hill that represented the hopes and aspirations of Israel, as God’s chosen nation through whom the nations would be blessed.
The above "city" in this photo is not only pictoresque , it is an example of a city set on a hill, with homes built on foundation of rock.