The BL Lac object S5~0716+714, a highly variable blazar, underwent an impressive outburst in January 2015 (Phase A), followed by minor activity in February (Phase B). The MAGIC observations were triggered by the optical flux observed in Phase A, corresponding to the brightest ever reported state of the source in the R-band. The comprehensive dataset collected is investigated in order to shed light on the mechanism of the broadband emission. Multi-wavelength light curves have been studied together with the broadband Spectral Energy Distributions (SEDs). The data set collected spans from radio, optical photometry and polarimetry, X-ray, high-energy (HE, 0.1 GeV < E < 100 GeV) with textit{Fermi}-LAT to the very-high-energy (VHE, E>100 GeV) with MAGIC. The flaring state of Phase A was detected in all the energy bands, providing for the first time a multi-wavelength sample of simultaneous data from the radio band to the VHE. In the constructed SED the textit{Swift}-XRT+textit{NuSTAR} data constrain the transition between the synchrotron and inverse Compton components very accurately, while the second peak is constrained from 0.1~GeV to 600~GeV by textit{Fermi}+MAGIC data. The broadband SED cannot be described with a one-zone synchrotron self-Compton model as it severely underestimates the optical flux in order to reproduce the X-ray to $gamma$-ray data. Instead we use a two-zone model. The EVPA shows an unprecedented fast rotation. An estimation of the redshift of the source by combined HE and VHE data provides a value of $z = 0.31 pm 0.02_{stats} pm 0.05_{sys}$, confirming the literature value. The data show the VHE emission originating in the entrance and exit of a superluminal knot in and out a recollimation shock in the inner jet. A shock-shock interaction in the jet seems responsible for the observed flares and EVPA swing. This scenario is also consistent with the SED modelling.