The thing you are missing is wall scaling.
In medieval, when you first get ballistas, it is possible to build walls with 11,100 HP each, and with each additional level walls gain HP faster than troops gain dps (and, at the same time, defensive structures gain dps). A lot of the time, due to...