Local Group satellite galaxies show a wide diversity of star formation histories (SFHs) whose origin is yet to be fully understood. Using hydrodynamical simulations from the Constrained Local UniversE project, we study the SFHs of satellites of Milky Way-like galaxies in a cosmological context: while in the majority of the cases the accretion on to their host galaxy causes the satellites to lose their gas, with a subsequent suppression in SF, in about 25 per cent of our sample we observe a clear enhancement of SF after infall. Peaks in SF clearly correlate with the satellite pericentric passage around its host and, in one case, with a satellite-satellite interaction. We identify two key ingredients that result in enhanced SF after infall: galaxies must enter the host's virial radius with a reservoir of cold gas Mgas, inf/Mvir, inf ≳ 10-2 and with a minimum pericentric distance ≳10 kpc (mean distance ~50 kpc for the full sample), in order to form new stars due to compression of cold gas at pericentric passage. On the other hand, satellites that infall with little gas or whose pericentric distance is too small, have their gas ram-pressure stripped and subsequent SF quenched. The pericentric passage of satellites likewise correlates with SF peaks in their hosts, suggesting that this mechanism induces bursts of SF in satellites and central galaxies alike, in agreement with recent studies of our Galaxy's SFH. Our findings can explain the recently reported multiple stellar populations observed in dwarf galaxies such as Carina and Fornax, and should be taken into account in semi-analytic models of galaxy formation and satellite quenching.