Cannon Towers fire powerful projectiles, which also deal "splash" damage to units adjacent to the point of impact. Note, however, that their shots may overshoot their target, and may also damage friendly units by mistake. Furthermore, they cannot effectively target units adjacent to them, and their shots will only deal minor damage to such units.
For optimal efficiency, towers should be protected by Walls or cheap buildings like Farms, which will also protect them against Sappers. They are much more effective if multiple towers are built close enough to cover each other.
Being immobile, they are vulnerable to all units that outrange them, especially Catapults and Death Knights. They also lack the power to effectively take on Juggernaughts, and are helpless against Dragons.
They cannot be controlled directly, and will fire automatically at enemy units, targeting enemies according to a built-in priority list:
Keep/Stronghold, Great/Town Hall, Mage Tower/Temple of the Damned
Barracks
Shipyard
Lumber Mill, Oil Refinery
Farm, Oil Platform
Other buildings
Note: Heroes are counted as their base unit, except Lothar, who is counted as a Paladin, and Alleria, Zuljin, and Dentarg, who are treated as the base version of their unit, rather than the upgraded one (Archer, Axethrower, and Ogre, rather than Ranger, Berzerker, and Ogre-Mage)