A large fraction of the luminous distant submillimetre-wave galaxies recently detected using the Submillimetre Common-User Bolometer Array (SCUBA) camera on the James Clerk Maxwell Telescope appear to be associated with interacting optical counterparts. We investigate the nature of these systems using a simple hierarchical clustering model of galaxy evolution, in which the large luminosity of the SCUBA galaxies is assumed to be generated at the epoch of galaxy mergers in a burst of either star formation activity or the fueling of an active galactic nucleus (AGN). The models are well constrained by the observed spectrum of the far-infrared/submillimetre-wave background radiation and the 60-μm counts of low-redshift IRAS galaxies. The ratio between the total amount of energy released during a merger and the mass of dark matter involved must increase sharply with redshift z at z < ∼ 1, and then decrease at greater redshifts. This result is independent of the fraction of the luminosity of mergers that is produced by starbursts and AGN. One additional parameter – the reciprocal of the product of the duration of the enhanced luminosity produced by the merger and the fraction of mergers that induce an enhanced luminosity, which we call the activity parameter – is introduced, to allow the relationship between merging dark matter haloes and the observed counts of distant dusty galaxies to be investigated. The observed counts can only be reproduced if the activity parameter is greater by a factor of about 10 and 200 at redshifts of 1 and 3 respectively as compared with the present epoch. Hence, if merging galaxies account for the population of SCUBA galaxies, then the merger process must have been much more violent at high redshifts. We discuss the counts of galaxies and the intensity of background radiation in the optical/nearinfrared wavebands in the context of these hierarchical models, and thus investigate the relationship between the populations of submillimetre-selected and Lyman-break galaxies.