Imagine that back in the times that the prevailing weapon combination was the sword and shield that somebody had suggested that because their military was only a defense force they'd only equip them with shields and armour, but weren't equipping them with swords or javelins because those were offensive weapons. Yes, it would have been obviously stupid, but let's consider why.
The meaning behind the saying "the best form of defense is attack" that the mere possibility of attack forces the opponent to dedicate significant attention to fortifications (in ancient times castles and strongholds, in more modern times radar installations etc) and then troops to garrison these facilities against attack, even if they are attacking you. Having to guard against an attack means that only a fraction of the total possible force can in actual practice actually be deployed to an attack.
If your potential opponents know that your troops couldn't hurt theirs then it'd mean that they would reduce the amount spent on fortifications (why bother?) it'd also reduce the amount spent on good armour (well, if they don't have swords then leather armour is going to be just as effective as metal armour, if you bother armoring your troops at all) and you'd make more swords, maces, spears and then hire more people for your military with the savings. And you can just buy ladders to swarm up the walls of the opponents fortifications, since your not going to have to worry about javelins getting thrown at your attackers and therefore you won't need siege artillery with longer ranges than their personal infantry weapons.
On a more political level of choosing to go to war, you know that your not going to get counter attacked, and that nobody is going to go around burning your farms, warehouses and industry so the risks to the politicians getting kicked out of power (either by being voted out, or strung up by an outraged mob) are relatively lower than an opponent that might hit back. The chances of going to war therefore rise.
In modern terms, flapping about stealth bombers means that your opponent spends more on fixed defences such as radar installations, bomb proofing things in case the bomber gets through and then building spare installations in case one gets blown up.