That's the problem in Pakistan. It only takes one al-Qaida sympathizer to compromise an operation by alerting the terrorists of an upcoming raid. We don't know that this happened in this case, but it seems likely.
Pakistan needs to set up a sting to catch these traitors and then hang them.