but in the few cases where there was war anyway, the pact didn't do much for me.
Usually, if your combined armies are big enough (really big enough.. if this doesn't push you significantly ahead of the other Civs beware... two of them can ally to double DoW you) it seems to work as a deterrent, which is the real purpose and sole real advantage of a pact. But when the pact fails, it's best not to expect anything but woes from it, though you can get lucky.
The AI doesn't really "come to help". It reacts to being DoWed by surprise. If your territories are contiguous and your ally see the enemy units, it will try to kill them. Sometimes it hunts them down in your territory (if you signed open borders...). The same way you could get lucky and the AI has a navy that finds itself near units of the aggressor, or it could have been training or moving an invasion force that it will rather use against the aggressor. Or the best: your ally was just about to DoW your aggressor, in which case it's ready to strike... You could also be lucky and your ally in on another landmass, with a territory contiguous to the aggressor's, and then you'll be left largely alone in the war.
Normally, not a whole lot happens, which is logical. If there's a threatening CS allied to the aggressor closer than you that declare war , your ally will defend against it or go hunt down its units instead. The aggressor will have prepared and sent a force toward you
or your ally with a specific city in mind. This isn't a proper alliance with coordinated action and plans, so each partner will have units placed for defense and after a surprise DoW the AI will react mostly defensively (and it's the same old AI, it will defend badly).
It can be useful at times to sign one with a very powerful yet relatively peaceful ally that won't pick fights, denounce others etc. They don't last too long, that's a good thing. If your ally's diplo situation change, never renew it. In a few games I've found that having a defensive pact with Hiawatha, who was peaceful but immensely powerful, was a good thing. It kept Bismarck which territory touched on mine and Hiawatha's peaceful, at least he had declared war a few times and never did again after the defensive pact. Meanwhile I had done my own military build up to match his, and then Bismarck switched to our ideology anyway and it was no longer necessary. In the meantime, it's Augustus that declared war on Hiawatha, and because three CS allies of his were protected by my friends, I lost two DoF and got denounced once. Most times it seems to be a huge trap.
- Your ally will pick fights you may not know about (he builds a Wonder, and suddenly , and another AI that disliked him now hates him and will risk to DoW him, forcing you to do it too automatically, and on the AI's turn... You might turn out to be in the way and suffer most of the attack.
- The aggressor will often be someone you wouldn't want to fight, who might even have a DoF with you that you betray (huge diplo hit with everyone), and he might even have CS allies, which could well be under the protection of third parties (another big diplo hit with those, who can alas have been your friends...).
- It's useless to sign DP with weaker/weak Civs. You're much better investing in better defense if you're in fear of attack.
- It's fairly dangerous to sign DP with Civs from other ideologies, especially that most of your friends probably follow your own. It's dangerous to sign DP with anyone who is disliked by other Civs. It's also very dangerous to sign DP with deceptive leaders like Bismarck or Wu.
- DP that fail can be absolutely catastrophic for your diplomacy. If you find yourself betraying friends, or DoW CS automatically that are under protection, you can find yourself denounced or DoW soon, and in the late game it might well get you chain denounced by other AI from different the other ideologies. Rather than secure your military, they can very often place you in greater danger.
Defensive Pacts would be truly useful only if you could sign them with multiple partners. But this doesn't work like that. If you have three pacts, one with each Order civ, you might think the Order block will go to war together but no...you have to be the one who gets DoWed for your three pacts to trigger. Otherwise no one declared war on you, you're the one who declared war after your ally got Dowed. Your two other allies won't DoW after you, your pact with them will rather be voided by your DoW.
I suspect they are above a little trap of the designers for the too peaceful, too friendly players who don't build a good army to deter the AI from attack. All too often they will land that player in exactly the sort of diplo complications he hoped to avoid with his "friendly"/peaceful play style.