It was just a manufacturer's desire that gave the A340 (at least, the standard A340-300) and the A330 different model numbers. They were fundamentally the same airframe design, built on the same assembly line, in fact the A330 wing spars long had four engine attachment points until Airbus redid the design after the A340 production was finished. It always seems quite reasonable to produce a couple of variants of a basic design and see which way the market goes. Could have gone either way. Overall they built nearly 2,000 of them, notably good going for a mainstream long haul type.
The A340-500/600, different fuselage length and big fan engines, were way more different, but just presented as variants.
I did several trips London to Sydney on Cathay Pacific. The difference of the quiet cabin going on overnight to Australia compared to the racket of the 777-300ER on the London sector was most noticeable.