As an economy, CA is one of the largest economies in the world. The state has done an excellent job of diversifying its economy to include agriculture, entertainment, tourism, and technology. Other states have tried - some have succeeded - others not so much.
My theory is that coastal states or states with ports have always been more open to trade and outside influences - and their economies reflect that openness and flexibility - despite the best efforts of Democrats to control the economy.
California’s GNP ranking as a nation would be #6 right after the UK and ahead of France.
https://en.wikipedia.org/wiki/Comparison_between_U.S._states_and_countries_by_GDP_(nominal)