Battering Rams are excellent siege weapons in being able to take down your opponent's Gatehouses, providing a clear path into an enemy castle for friendly troops.
Apart from using ranged attacks, for example using Trebuchets or Catapults, these are one of the only ways of being able to destroy enemy gatehouses while using the standard siege units available. There are however several special units available that can also destroy walls, including gatehouses.
Battering Rams are fairly durable, so unless your ranged units specifically attack them, there is little chance they will take these siege weapons out by chance. This allows them to slip through and deal out a lot of damage to your Gatehouses.
Note however that man traps and other similar siege defences can still impact on your Battering Rams, as can fire. The Ice Queen can also attack Battering Rams and do some significant damage, but they cannot actually be frozen by her.
Battering Rams do not take a long time to quickly demolish Gatehouses once they start and it's very important to try your best to prevent them getting near in the first place. Regardless of whatever faction you are using, Gatehouses only take 5 hits to be completely destroyed from a single Battering Ram. They are also fairly durable against other ranged attacks, for example Catapults or Trebuchets, as well as melee units, so you will need to focus resources on Battering Rams to take them out successfully.
You will need 150 gold for a Battering Ram, along with 1 peasant from the campfire before it can be recruited.