While the bombings have clearly had an effect on the voting, there are other aspects:
- First of all, the Popular Party was sure to lose the absolute majority by a good margin. Things like the war in Iraq, the management of the "prestige" spill, and the fact that the popular party didn't want to participate in a televised debate against the other parties played an important role in that.
- But the bombings in Madrid triggered two courses of events that caused the surprise in the election results:
1. The government clearly wanted the citizens to think that the bombing was one of ETA, even when there were leads that pointed to Al Qaeda. Minister Ana de Palacio sent a diplomatic memo to all embassadors asking them to "use every possible chance to make clear it was an attack from ETA and dismiss any rumors stating otherwise" HOURS AFTER they found the koran tapes and other material that clearly showed that the most probable author of the massacre was Al Qaeda.
That caused spontaneous demonstrations in the streets against the government (more than 50.000 in Madrid), feeling they had been purposedly misleaded in order to win votes.
2. The fact that it was Al Qaeda and not ETA brought back the "anti-war" sentiment and, most importantly, made most socialist voters that stayed home in 2000 go vote this time.
That's my analysis, and so take it cautiously, as I may be far off.
Daniel