Re: State border crossings, too
California's 16 border inspection station are manned by the State Dept of Food and Agriculture, not by Federal DHS. They were put in place to protect crops - and thus, the state's economy - from threats such as (originally, IIR) the Mediterranean Fruit Fly and have remained fairly true to that purpose by inspecting vehicles coming into the state. Especially commercial vehicles.
https://www.cdfa.ca.gov/plant/pe/ExteriorExclusion/borders.html