So by joining NATO you are actually less likely to be attacked because you know all the members will fight back.
That’s the purpose of an alliance. It kept Western Europe free of Soviet dominance for 45 years.