Deterrents are not absolute. Also, I don’t know how you’re not aware of this, but it was Ukraine’s announcement they’d be joining NATO that provoked Russia. That doesn’t sound like an alliance preventing war, does it… As I said - deterrents are not absolute. They never are. Police and prison (allegedly) deter crime, for instance.