Unfortunately, pickpocketing in Madrid is an art form. I know Madrid very well, I don't think I have that dazed "where am I?" look on my face, and I can speak Spanish well. Yet, I stick out like a sore thumb as a foreigner, which makes me an easy target. I think that the truth is that those of us who do not live in places where pickpocketing is so common do not have the same instincts about always being vigilant. Even though I KNOW in my head that Madrid is full of pickpockets, I have a hard time keeping the radar on all the time. Sure, when the metro is jammed, or when the crowds are pushing up an escalator or out through a metro gate, then I pay careful attention, but the rest of the time I just lapse into my normal mental state, which means that I am not going to be alert for pickpockets every second of the day.
The way I solved this was not by trying to train myself to be more alert and vigilant, because no matter how hard I tried, I couldn't do it, and who wants to spoil your day by scrutinizing every person who gets near you anyway? So, I decided to go with one of those under the shirt pouches -- it carries everything essential when I'm in transit. That lets me off the vigilance hook and I don't have to worry. In fact, last spring, one of those clever guys on the metro did open a bag I had in my hand before I realized it, but there was nothing he was interested in, so the only harm done was that sense of being invaded or violated by an alien.
So, I don't want to disagree with those who urge more vigilance and caution, but I do think that realistically many of us are never going to develop that talent/instinct. Now that I've come to that realization, my travel is much less of a hassle, and I just let the pouch take the worry out of the experience.
I know, too, that being pickpocketed gives you a terrible sense of violation, even if you don't lose much, and I hope that the peregrinos on this forum don't have to deal with that on their Caminos.
Buen camino a todos, Laurie