With an old automatic, it was a Hail Mary shot with just the right amount of Kentucky windage.
He used a 20x Unertl scope and a mount fashioned from scrap aluminum by some Sea-Bees. Because of the .50 BMG's range, and because the US military tended to push back the jungle for a considerable distance from their defensive perimeters, this set-up actually was fairly common in Vietnam.
Despite his distance record having since been eclipsed, Hathcock's shot remains the longest sniper shot that was certifiably taken from a cold bore. Some reports claim that the Canadian sniper's 2(+) mile shot in Iraq was a CBS but there is no substantiation (mission: classified). If it was, I suspect it was a "demonstration" shot using DARPA's self-steering .50 bullet. And the peripheral circumstances surrounding that shot lead me to believe that might have been the case.
The fact that it might have been an old barrel is no handicap (unless you take "old" to also mean "shot out"). The US military bought so many barrels during the two world wars that (both times) the barrel manufacturers flooded the markets with the Pratt & Whitney barrel milling machines, which they found themselves overstocked on when the war(s) ended. The machines are massively overbuilt and the tooling might wear out but the machine itself is essentially immortal. Basically every custom barrel manufacturer in the US still is using a war surplus sine milling machine to cut the rifling in their high-end barrels.