What you saw there was a Cathay Pacific A340-300, most likely making a journey between New York and Hong Kong.
CX used to offer two one-stop options from HKG to JFK, one or two flight daily will stop in ANC for a F1-style 70-minute pit stop for fuel and crew, one additional flight stopped in YVR for fifth-freedom passengers in addition to gas and crew. The ANC stop was discontinued when CX leased several A340-600 to eliminate the stop. The YVR flight is still going strong (CX888/889) as a complement to the plethora of non-stop flights; they’re all operated by the 777-300ER.
It is also possible that the A340-300 was making a flight from YYZ to HKG. This flight does not allow for a crew change due to post-9/11 rule changes. So the plane does a lightning gas-and-go to satisfy crew rest requirements. The speed of the turnaround is quite literally limited by how fast 11 hours of fuel can be pumped into the aircraft, once the fueling hatch is closed, it’s off to the races.
The same idea applies to the NH 767, probably coming from JFK and the plane probably doesn’t have the legs to make it to NRT in one segment. With the flight time being significantly shorter, I would imagine this would be a gas-and-go for NH without a change of crew and less time pressure.
Cargo aircraft still operate into ANC in order to maximize payload capacity. They can make it across the pond, but they would be giving up several tonnes of cargo if they went non-stop.