One man carried out his attack with a gun banned by the state, while the other used a gun he legally owned, police said.
Even in California, a state with some of the country's strictest gun laws, the limits can be sidestepped.
The prospects for new federal gun laws are dim.
The majority of guns used in mass shootings were obtained legally, according to the nonprofit Violence Project, which maintains a database of attacks.
Chunli Zhao legally owned the gun used in the Half Moon Bay attack on Monday, police said.