What are the advantages of the battering ram?

the battering ram was only used to basecly open castle walls by force and well they were used so most of the army wouldn't get killed outside the castle by archers. it was basecly so the opposing army can get the advantage of bringing the fight inside the castle