  At least 30\% of main sequence stars host planets with sizes of between 1 and
4 Earth radii and orbital periods of less than 100 days. We use N-body
simulations including a model for gas-assisted pebble accretion and
disk--planet tidal interaction to study the formation of super-Earth systems.
We show that the integrated pebble mass reservoir creates a bifurcation between
hot super-Earths or hot-Neptunes ($\lesssim15M_{\oplus}$) and super-massive
planetary cores potentially able to become gas giant planets
($\gtrsim15M_{\oplus}$). Simulations with moderate pebble fluxes grow multiple
super-Earth-mass planets that migrate inwards and pile up at the inner edge of
the disk forming long resonant chains. We follow the long-term dynamical
evolution of these systems and use the period ratio distribution of observed
planet-pairs to constrain our model. Up to $\sim$95\% of resonant chains become
dynamically unstable after the gas disk dispersal, leading to a phase of late
collisions that breaks the original resonant configurations. Our simulations
naturally match observations when they produce a dominant fraction
($\gtrsim95\%$) of unstable systems with a sprinkling ($\lesssim5\%$) of stable
resonant chains (the Trappist-1 system represents one such example). Our
results demonstrate that super-Earth systems are inherently multiple (${\rm
N\geq2}$) and that the observed excess of single-planet transits is a
consequence of the mutual inclinations excited by the planet--planet
instability. In simulations in which planetary seeds are initially distributed
in the inner and outer disk, close-in super-Earths (abridged).
