Today's Associated Press report, Spain attacks: Police find belt with explosives filed this afternoon from Madrid (7:45 Eastern U.S. time) is extensive (good reporting!), so I'm only going to quote one passage, which suggests the investigators caught an incredibly fortunate break (emphasis mine):
... The two — Mohamed Houli Chemlal, 21, and Driss Oukabir, 28 — identified [the imam] Es Satty as the ideological leader of the cell according to a Spanish judicial official who attended the proceeding and briefed journalists but wasn't authorized by the court to be identified in news reports.
Investigators believe that Houli Chemlal is key to shedding further light on the imam's role and plans as the only survivor in the blast in Alcanar where Es Satty and another cell member died last Wednesday, the official said.
Houli Chemlal was arrested in a hospital after surviving the blast. He told the court he was alive because he was on the outside porch of the house washing dishes after dinner.
[In addition to the new find of the explosives belt] Police had already found at the house more than 100 tanks of butane gas, nails that they planned to use as shrapnel, and 500 liters of acetone, a highly flammable liquid necessary to make TATP, an explosive used by Islamic State group militants. ...
While an accident in a bomb-making factory is not uncommon, the eerie aspect of the Alcanar blast is that it took the life of the imam who was making the bombs reportedly to blow up a cathedral.
It's possible Chemlal believes God spared him so that he could help the investigators and that he sees the death of Es Satty as the breaking of a spell. By all accounts, Satty had an almost hypnotic effect on the young men who fell under his influence.
In any case, Chemlal's injuries weren't severe enough to prevent him from talking and didn't interfere with his memory.