Vanilla and Rise and Fall
A siege in ancient times was really a grueling experience. Melee units do significantly reduced damage versus city fortifications, which could make even taking down Ancient Walls difficult. The Battering Ram solves this problem, allowing melee units to do full damage to Walls! Note that you will still need to beat the Walls before attacking the city proper for real.
The Battering Ram becomes obsolete (cannot be produced anymore) after developing Civil Engineering; it also becomes useless when the target civilization has itself developed Urban Defenses. It can be upgraded then to a Medic and salvage at least some of its usefulness.
In Gathering Storm, the Battering Ram is useless against anything but Ancient Walls! This plays much better into the historical accuracy of the unit, and adds a new layer of sophistication to early-to-middle game tactics.
As the walls protecting towns got higher and thicker, so too did the gates. Eventually, it wasn’t enough to have a bunch of expendables hammering away at the gate carrying a thick pole. In its simplest form, a battering ram is a heavy log suspended from a framework that can be swung against walls and gates, eventually – theoretically – knocking them down. Over time, the ends were capped with metal, wheels were added for mobility, and coverings protected the users from boiling oil, rocks, arrows and other discomforts. So useful were battering rams that, if they couldn’t be constructed from materials nearby, ancient armies would drag them along on campaigns. Pliny the Elder even described their use in mining for breaking down hard rock (although a bunch of slaves with picks was a lot cheaper). Battering rams were used right through the Middle Ages, until the advent of gunpowder brought cannons into the art of war.