To 'dub' (hence 'dubbing'), in the sense pertaining to sound on film, shortens 'double'. The term in this sense originated during the development from silent motion pictures to sound pictures. 'Dub' and 'dubbing' continue to be used more generally than the sense of 'overlaying another language on the original language of a motion picture' suggests.
The first reference to 'dub' or 'dubbing' that I could locate in published sources was this from the 22 Jul 1928 Los Angeles Times, p 76 (paywalled link), describing a soon-to-be completed Movietone production plant:
The recording building will provide space for a generator room, transmission room, amplifier room, film experimental laboratory, recording room, dubbing room, wax shaving room, transmission laboratory, battery room, dark room, shipping department and vault.
The process of 'dubbing', and how it differed from other contemporary synchronization processes, is detailed a short two years later in The Art of Sound Pictures (Walter B. Pitkin and William M. Marston, Appleton, 1930):
Still another method of synchronizing the sound record and the photographic record is known as "dubbing" the sound on the picture film. A silent picture may be photographed in the usual way, without any sound apparatus whatsoever on the set. The film is then developed and run in a projection room in which sound recording apparatus is set up. An orchestra plays an accompaniment to the silent picture as it is shown on the screen, and the orchestration is recorded on a separate sound film, which is synchronized with the film upon which the pictures are already recorded. Then the two strips of film are taken to the laboratory, and the sound and picture records are put on the same film.
This process of dubbing on orchestartion or other sound effects, such as the shooting of guns, the squealing of pigs, the roaring of floods, etc., may be performed in the same way on a film which already carries both picture and dialogue records. The volume and intensity of the music and other sounds are then softeneed in the process of dubbing, so that the dialogue comes out clearly against the background of rushing water or violin obligato.