And it also works in reverse, but since every other state is much smaller, no stories are written. Both of my neighbors have recently left Texas to relocate to the Bay Area.
California has lost people to net domestic migration for a few decades (with lower income workers and retirees flowing out and, on average, higher wage workers flowing in at slightly lower rates from other states), IIRC, but until recently it was making up for it between natural growth and international in-migration [0] (the latter also often of higher wage workers); international migration tailed off just before (and even more with) the pandemic, which shifted things to a net loss of population.
[0] Carefully not saying "immigration" because a H-1B admissions, an important part of this, aren't immigrants, even though they may later become immigrants. But its still in-migration of population, regardless of status.