Sacramento, for example, has been the capital of CA since 1854. At the time, the population of Sacramento was 10,000, San Francisco was 34,000, Los Angeles didn't exist yet, and most economic activity centered around gold mining, which usually happened near the Sacramento hinterlands.
Similarly Nevada's capital has been Carson City since 1864. In 1864 the primary industry in Nevada was silver mining of the Comstock Lode, which is right next to Carson City. Las Vegas didn't exist until 1905.
Some state capitals also have rather colorful histories, as well. The capital of Louisiana was moved from New Orleans (the economic center) to Baton Rouge because "New Orleans was too sinful". The capital of Idaho moved from Lewistown (the previous economic center, driven by a gold rush) to Boise (the new economic center, driven by mineral mining) in violation of a court order, and featured the governor fleeing the state for Portland and the state treasury being stolen from his steamboat cabin.
There's a catch-22 for settlement patterns where large-scale settlement and economic development of many states didn't happen until after they gained statehood, at which point the capital is already decided.