One can distinguish five reasons why God allows the devil to attack us:
Second, so that our virtue may be maintained in the heat of the struggle and so be confirmed in an impregnable position;
Third, so that as we advance in virtue we may avoid presumption and learn humility;
Fourth, to inspire in us an unreserved hatred for evil through the experience we thus have of it;
Fifth, and above all, that we may attain inner freedom and remain convinced both of our own weakness, and of the strength of Him who has come to our aid.