I was pickpocketed a few years ago and I searched all the bins in the area and I came up with ID cards, medical cards, bank cards etc of 9 different people that had been robbed that night!
I think the thieves do this because if you point them out to the police they won't have any evidence on their possession. Because if they have someone's ID on them they will have some explaining to do. For some cash not so much, you can't prove it was yours.
Not that the police do anything anyway because the Spanish law lets them go free with a minor fine if they stole less than 400 euro, even if it was the 50th time this month. This is really why pickpocketing is so extremely rampant here, it's risk-free and the gangs are basically professional businesses.