We study the dilepton production in heavy-ion collisions at energies of 1-2 AGeV as well as in proton induced pp, pn, pd and p + A reactions from 1 GeV up to 3.5 GeV where data have been taken by the HADES collaboration. For the analysis we employ three different transport modelsthe microscopic off-shell Hadron-String-Dynamics (HSD) transport approach, the Isospin Quantum Molecular Dynamics (IQMD) approach as well as the Ultra-relativistic Quantum Molecular Dynamics (UrQMD) approach. We find that the HSD and IQMD models describe very reasonably the elementary pp, pn and πN reactions despite of different assumptions on quantities like the excitation function of the ∆ multiplicity, where solid experimental constraints are not available. Taking these data on elementary collisions as input, the three models provide a good description of the presently available heavy ion data. In particular, we confirm the experimentally observed enhancement of the dilepton yield (normalized to the multiplicity of neutral pions N π 0 ) in heavy-ion collisions with respect to that measured in N N = (pp + pn)/2 collisions. We identify two contributions to this enhancement: a) the pN bremsstrahlung which scales with the number of collisions and not with the number of participants, i.e. pions; b) the dilepton emission from intermediate ∆'s which are part of the reaction cycles ∆ → πN ; πN → ∆ and N N → N ∆; N ∆ → N N . With increasing system size more generations of intermediate ∆'s are created. If such ∆ decays into a pion, the pion can be reabsorbed, however, if it decays into a dilepton, the dilepton escapes from the system. Thus, experimentally one observes only one pion (from the last produced ∆) whereas the dilepton yield accumulates the contributions from all ∆'s of the cycle. We show as well that the Fermi motion enhances the production of pions and dileptons in the same way. Furthermore, employing the off-shell HSD approach, we explore the influence of in-medium effects like the modification of self-energies and spectral functions of the vector mesons due to their interactions with the hadronic environment. We find only a modest influence of the in-medium effects on the dilepton spectra in the invariant mass range where data with small error bars exist.