  We present a detailed characterisation and theoretical interpretation of the
broadband emission of the paradigmatic TeV blazar Mrk 421, with special focus
on the multi-band flux correlations. The dataset has been collected through an
extensive multiwavelength campaign organised between 2016 December and 2017
June. The instruments involved are MAGIC, FACT, Fermi-LAT, Swift, GASP-WEBT,
OVRO, Medicina and Mets\"ahovi. Additionally, four deep exposures (several
hours long) with simultaneous MAGIC and NuSTAR observations allowed a precise
measurement of the falling segments of the two spectral components. The
very-high-energy (VHE; E > 100 GeV) gamma rays and X-rays are positively
correlated at zero time lag, but the strength and characteristics of the
correlation change substantially across the various energy bands probed. The
VHE versus X-ray fluxes follow different patterns, partly due to substantial
changes in the Compton dominance during a few days without a simultaneous
increase in the X-ray flux (i.e. orphan gamma-ray activity). Studying the
broadband spectral energy distribution (SED) during the days including NuSTAR
observations, we show that these changes can be explained within a one-zone
leptonic model with a blob that increases its size over time. Our multi-band
correlation study also hints at an anti-correlation between UV/optical and
X-ray at a significance higher than 3 sigmas. A VHE flare observed on 2017
February 4 shows gamma-ray variability on multi-hour timescales, with a factor
10 increase in the TeV flux but only a moderate increase in the keV flux. The
related broadband SED is better described by a two-zone leptonic scenario
rather than by a one-zone scenario. We find that the flare can be produced by
the appearance of a compact second blob populated by high energetic electrons
spanning a narrow range of Lorentz factors.
