The war in Ukraine has demonstrated that even if you have no intention to fight a war, an aggressive neighbor may have other ideas, so you don't have a choice other than being ready for it, if you want to continue existing as an independent country.
How you're ready for it can vary, but deterrence by having better weapons is one effective way. In the best case, it works and you don't have a war. And if it doesn't, you still have better weapons to end the war - and preferably keep it on the enemy's territory so the destruction happens there and not in your country.
Right now, Ukraine has its cities leveled, while Russia is (with a few exceptions) "only" losing military gear and personnel.