Excellent responses above. Let me attempt to build on what's been said a little.
In the initial phase of a war I try to have a plethora of siege weapons (cats, cannon, artillery, air, depending on the era), not just for eliminating city defenses and inflicting collateral damage on city defenders (crucial roles for siege), but also for the purpose of dealing with the AI's stack. The siege weapons will mete out the initial collateral damage. This will especially, I'm hoping, reduce the effectiveness of the stack defenders. I'll often retain old siege units rather than deleting them for this purpose, especially since the AI often includes a mix of units from different eras in its stacks--thus, cats can still be surprisingly effective even in the gunpowder era. (Just be sure to have a way to deal with the war weariness that will result from heavy losses of obsolete siege weapons; coaxing the enemy stack into your own cultural territory to be killed is one way to do this.)
After the siege units are done I attack the stack to destroy it, usually with mounted units--and not just for the reason lymond mentioned, that they'll do flanking damage to siege units, though that's certainly handy. In addition, (a) I give mounted units flanking promotions to increase their chances of survival in a fight; and (b) the extra movement point also increases their chances of survival, as they can retreat if damaged whether they are victorious or lost but survived thanks to a flanking withdrawal.
Basically, mounted units are great stack attackers because there's a better chance your hammer investment in them won't be lost. But you need to help them out with those siege attackers first to reduce the strength of the anti-mounted defenders in the stack.