I find there's quite a few ways to address incoming threats. If I have to plan to retake the city then the sooner I have to set those plans the better. But usually I stock my cities with the ability to draw half of the defenses from all neighboring cities and send them to the city that looks to be under attack so that they can get there in time to make a difference in the battle. I usually maintain counterattack stacks if I'm on top of my defense game and even regional added defense reinforcement stacks. These strategies, even once setup, require being alerted asap when a problem comes in, to the point that I usually have a dog on sentry in every city to wake up whenever it sees a threat because even this alert isn't often enough for me to know for sure I'm aware every round of all possible threats.
Well, unless you're purposely making your games harder, mostly depends on you not being mediocre in the first place.
As in, don't "struggle to survive", rather "aim to dominate", at least in certain significant senses.
And that involves a much more long-term strategy, namely to decide what your empire is going to be focused on: army, gold, science, religion, espionage, population, etc.
Each of those options requires a very different focus nearly from the very start of the game, so you should decide it already during Prehistory.
Like I showed in UEM thread, I was struggling in score and buildings, yet I managed to raise an army that simply wiped out a much more massive neighbor in one strike.
Because I focused my resources into one goal (strong army), instead of spreading it all over the place and achieving nothing much in the result.
I could have spent hundreds of turns on catching up with buildings and science, but by then I would never catch up with their army (since they wouldn't wait for me either).
So I sacrificed the quality of my city for the sake of gaining ANOTHER city.
Sure, it was a lot of luck involved and so on, but I'm sure my point still applies in most cases.
Also, in fast games, I tend sometimes to focus entirely on Wonders, growing so much beyond all neighbors that they usually are easily eager to be vassalized by me.
As in: why fight them, if I can get them for free?
Or, yet another option I used to use a long time ago - spies and buying their cities (either for espionage OR literal gold, the latter being the funniest).
Yes, you CAN buy non-capital cities - and yes, it's FUN.
So there's plenty of ways to wage war WITHOUT a literal soldier army.
It all depends on the relative difficulty of the game in question (or lack thereof).