Ports were and are the most effective method for transporting trade goods. It is natural that societies were founded around Port cities.
Rail is the reason interior cities can exist, but they haven't had nearly enough time for those cities to develop compared to coastal port cities.
(post is archived)