California was actually quite conservative and had better gun rights than most of the east coast, and even a lot of the nation in the 1980s. When the gang culture exploded California began down the road it is on now with the population being duped into given up their rights.
Prior to that they got scared of the armed black panthers and started the initial restrictions when Republican champ Ronald Reagan banned open carry.
Later Republican champ Ronald Reagan would also grant Amnesty to millions of illegals, most of whom lived in California and while the Bay Area was already quite left leaning from the influx of every demographic that didn't fit in in the rest of the country flooding to it in the 1960s, the state didn't become permanently blue until Reagan gave amnesty and added millions of votes to the other side.
The middle the country cannot stand against the coasts.
This is much bigger than Republican/Democrat, but the only reason Trump won is the electoral college, which barely allowed both Trump and George W. Bush in his first election to get in power.
They lost the popular vote, and the demographic changes in the US mean they will continue to lose ground, because the growing parts of our population are not conservatives.
The middle of the nation has less population and also spends more government money than it generates. The feds get most of their money from New York, California, and yes Texas. The states that generate most of the federal government's money are left leaning.
Look up the many graphs and maps of federal taxes vs federal spending. As well as total revenue generated, as well as per capita, and you start to see something. Here is one that spans a good couple decades covering federal spending vs revenue:
View attachment 783067
Much of the conservative generally more pro-gun America make the feds less money than they cost them or break even.
Like it or not California, New Jersey, Massachusetts, Connecticut, Rhode Island, Illinois, New York, and etc with the most restrictive gun laws in the nation pay for Louisiana, Mississippi, Alabama, Arizona, etc with strong gun rights.
Why does that matter? Well money is what the government operates on and you better believe they take note. It also means the people it relies on the most to accomplish what it does are generally from more left leaning liberal areas that generally have less firearm freedom. Texas, Ohio, and Pennsylvania tow the line, but the feds definitely depend more on left leaning anti-gun locations to fund the government.