There are many reasons for a place being named. How they were named very much depends on where they are and when they were named.
Some places are named after people. Rome was named after one of its founders, Romulus. New York was named after the English Duke of York.
Some places are named as reminders of places. New Amsterdam was named after Amsterdam and was the name of New York before it was changed by the English. Boston in America is named after Boston on the coast of England, So is Portsmouth.
Boston in England was, however, named centuries earlier when it was named by the invading Saxons. At that time the Saxons often named places after people and the landscape. So Reading is Redd -ing, which means the settlement (ing) founded by the chieftain Redda. Boston in England was named in Saxon times after the missionary St Botolph. The ending -ton means enclosure, or homestead.
Wednesbury means Woden's Hill (Wednes comes from the god Woden, and bury means hill).
Oxford means the ford (easy crossing place ) for oxen, indicating that the river was wide and shallow at that point. And so on.
When the Romans were naming places they often used a name plus the fact that it had a fort, or castrum. Castrum later became 'chester', hence Manchester or 'caster' (Doncaster).
When the Spanish were naming places as they colonised the west coast of America, they used the names of saints or referred to other holy words, hence San Francisco and Los Angeles.
Later, during times when prospectors rushed to seek riches in America and elsewhere, they rapidly set up towns and named them after the mineral, hence Goldfield, Nevada and Leadville, Colorado.