We are more affected, more changed, by what we do than by what is done to us. No matter what you go through, you remain, or can remain, the same person you were before the experience. Sure, you will be affected; perhaps hurt, perhaps saddened, perhaps fatigued; maybe you will be more cynical, less trusting, and so on; because of your experiences; but you are fundamentally the same person.
What happens to you does not change your basic character, even if it may change your personality and perspective. But your actions, the things you do, the good and the bad, directly impact who you are as a person. You can be tortured, and be the same man when it is over, but you cannot torture someone and not be changed by what you have done. You will have become a man who tortured someone. You will have fundamentally mutated. Even if you make taubah and istighfar, you will always know that you did it, and are capable of it; and you will have to be vigilant to guard against doing anything like that ever again.
And the same is true for righteous acts and acts of bravery; you become a different person, a better person, by doing these kinds of things. Why did Allah Command us “Do deeds!”?
There is nothing mystical about the connection between sin and defeat; it is not vague or abstract. Your sins change you; they change your character. Allah’s Displeasure manifests itself in these negative changes. You become someone lacking the qualities for victory. You lose your drive, your discipline, your patience, your seriousness; you become accustomed to behaving unintelligently, selfishly, emotionally; you lie, you hide, and you become distracted and short-sighted. Sin disables you in a very practical and immediate way. That is why it is referred to as “self-oppression”.
We have to understand this. Avoiding sins is not restrictive, it is healthy, it is what you do when you genuinely care about your own wellbeing, and the integrity of your own character.