What’s wrong with those voters in Fresno and Bakersfield?  Don’t they know the party bosses pick the candidates and their only job is to troop to the polls and vote for them?

Apparently not, since the Democrats just blew a safe Democratic Senate seat in a Central Valley special election in which the bosses achieved the amazing contortion of seizing defeat out of the jaws of almost certain victory.

Last February, popular Democratic Sen. Michael Rubio (D Bakersfield) resigned this Bakersfield-Fresno area Senate seat to take a job with Chevron.  The district was overwhelmingly Democratic; President Obama handily carried it in 2008 and 2012, as did Gov. Brown and Sens. Feinstein and Boxer.  Rubio got 61 percent in his 2010 election.

But the vacancy left the Democrats with two problems: no obvious candidate on their side and a potentially strong Republican candidate, a Hanford cherry grower Andy Vidak, who had run for congress in an overlapping district in 2010.  After the two overlapping Democratic Assembly members decided not to run, party leaders in Sacramento faced a dilemma.  The leading Democrat was one Fran Florez, mother of the former Senator for this district, but she had lost a couple of races for the Assembly.

In a classic case of pride goeth before the fall, the Sacramento party bosses forced Florez from the race, and decided to put their muscle behind a first term Bakersfield Supervisor named Leticia Perez.  Down into the district came a Democratic campaign team followed by boatloads of Democratic money.  That should have settled the matter, or so they thought, but it did not.

It seems that no one in the district knew who Leticia Perez was, not surprising since her supervisorial district is way at the southern end in Bakersfield and most of the population is to the north in Fresno, Kings and Tulare. In the May primary, Perez did manage to pull 43 percent of the vote, and Vidak nearly won the seat outright with 49.8 percent.  He ran about 20 points ahead of GOP registration and she ran eight points behind Democratic registration.

But still there was every reason to believe that Perez would win in the end; the runoff featured just one Democrat and one Republican in a hugely Democratic district, and the Democratic leadership and their union allies opened their wallets even more to assure a Democratic victory.

But then onto the scene came the California Realtors Association.  It seems that the Realtors and the Democratic Senate leadership are in a capital tussle over a piece of legislation, and in a move reminiscent of the Corleone family, the Realtors decided to make a point.  Into the district rolled an $840,000 Realtor independent expenditure complete with TV ads, direct mail, precinct walkers and the other appendages of a full campaign against Perez and for Vidak.  This money more than equaled Democratic independent expenditures in favor of Perez, and she ended up in the middle of someone else’s political brawl.

Vidak meanwhile came from the center of the district, had strong ties to agriculture and could portray himself a sensible sort of fellow who’d work with both parties in Sacramento.  Perez never really caught on with voters in Fresno, the population center of the district, and was in effect the innocent victim of a war between the Realtors and the Democratic leadership.

So what is the lesson here: first stay out of other people’s primaries.  Had Florez been allowed to run, she and Perez would have had to sell themselves to Democratic voters in the district, and Perez would have been a stronger general election candidate.  As it was, Perez seemed little more than the candidate of Sacramento money, and in a rural small town district like this, voters don’t like that.

Second, campaigns and candidates do count.  Perez never did get out from under the perception of being just a tool of Sacramento, even though she tried.  In Vidak the Republicans had a candidate with deep local roots; and someone smart enough in a district like this with a huge Latino population to endorse immigration reform.  It is probable he got more Latino votes than Republicans have been getting lately.

On Election Night, Vidak rolled up a 54 percent total, some 25 points ahead of GOP registration in this district.  There are additional votes to be counted but his margin does look too great for the Democrats to overcome and Perez has conceded.

While this is just a single special election, it does bring the GOP total to 12 Senators, and does somewhat imperil in 2014 the current two thirds margin Senate Democrats enjoy.  It also pumps life in a moribund state Republican Party, nothing like actually winning an election to prove you can still be relevant.

Finally, a lesson for the losing Senate Democrats: sometimes it is just better to leave things alone and let the voters decide who should represent them.