A second, probably related question, why are the city borders of LA so unusually shaped?
Los Angeles, like most of the really large cities in the United States, expanded by annexing nearby or adjacent munincipalities. In most cases, votes were taken and the bigger city would offer the residents in the smaller towns such enticements as a water and sewage system or a bigger and batter school district.
To the south of Los Angeles, the city was able to annex a thin, narrow strip of sparsely populated land, known as the "Shoestring Strip". This was done in 1906 and was done by a fiat imposed by the state of California. This gave Los Angeles a direct link to the smaller towns of Wilmington and San Pedro. Wilmington and San Pedro voted to join Los Angeles in 1909. Long Beach declined to join at the time and continued to refuse in two subsequent referendums.
Long Beach and Los Angeles are cut throat competitors as they vie with each other to entice ocean going cargo shipping lines to use their port and not the other port that is right next door.
Source: "Where Rails Meet the Sea: America's Connections Between Ships and Trains" by Michael Krieger (1998)