I used to cross at San Ysidro frequently, and would get pulled into secondary maybe 1/4 of the time. This is extremely common if you're crossing the land border alone, and you don't 'look Mexican.'
Even if you don't get pulled into secondary, they're extremely unpleasant to deal with.
I don't think I ever came across a border patrol agent during that time who didn't appear to be actively going out of their way to be mean. They don't even pretend to be welcoming or polite. They are there to make you feel small and under pressure, and in that process they are looking for any excuse to pull you into secondary. They know that you have zero power in that situation. Just try using the bathroom after sitting in the border line for 3 hours and then getting pulled into secondary and sitting in your car for an hour waiting for them to show up with a drug dog.
The Mexicans will sort of do something similar. I've been flagged by their secondary before, but they are always extremely polite. Even the soldiers in fatigues with FALs are pretty nice guys in my experience.
I think there is something in the training and recruitment of US CBP that is incredibly broken. As an American, everytime I cross the border back into my own country I am deeply ashamed.