LA was never a good natural harbor - in fact I think it was pretty terrible. But they had a lot of cattle hides to export, so ships came, which built up the city, so more ships came, and on and on and on until it was worth building the port facilities:
> The fourteenth of August (in the year 1834) was the day fixed upon for the sailing of the brig Pilgrim, on her voyage from Boston, round Cape Horn, to the Western coast of North America.
> What brought us into such a place, we could not conceive. No sooner had we come to anchor, than the slip-rope, and the other preparations for southeasters, were got ready; and there was reason enough for it, for we lay exposed to every wind that could blow, except the northerly winds, and they came over a flat country with a rake of more than a league of water.
> I also learned, to my surprise, that the desolate-looking place we were in furnished more hides than any port on the coast. It was the only port for a distance of eighty miles, and about thirty miles in the interior was a fine plane country, filled with herds of cattle, in the centre of which was the Pueblo de los Angeles,– the largest town in California,– and several of the wealthiest missions; to all of which San Pedro was the seaport.
https://www.gutenberg.org/ebooks/4277