I read a report why major armour-operating countries like US,
Russia, China, Israel etc are still building tanks with bigger and
bigger guns instead of just relying on ATGMs.
In a scenario of 2 opposing AFVs - one with a 120mm gun and the
other with a ATGM - spotting each other at the same time and firing
at the same time, the gun tank will get off the first shot earlier
and hit the target well before the one armed with ATGM.
The ATGM flies a lot slower than a gun projectile.
Also, during the Yom Kippur War, where ATGM were first used on a
massive scale, IDF tanks eventually developed tactics to try and
"dodge" the Sagger if they were lucky enough to spot them early
on.
Furthermore, a tank gun with different types of ammo is still more
versatile than a ATGM-armed vehicle. In one Fallujah battle (on
Youtube), the US Bradley fired a ATGM at a house when the 25mm
proved unable to demolish the walls or something. Not only is a
ATGM less effective against a bunker but also a hell lot more
expensive.