  Observations have revealed that the star formation rate (SFR) and stellar
mass (M$_{\rm star}$) of star-forming galaxies follow a tight relation known as
the galaxy main sequence. However, what physical information is encoded in this
relation is under debate. Here, we use the EAGLE cosmological hydrodynamical
simulation to study the mass dependence, evolution and origin of scatter in the
SFR-M$_{\rm star}$ relation. At $z=0$, we find that the scatter decreases
slightly with stellar mass from 0.35 dex at M$_{\rm star} \approx 10^9$
M$_{\odot}$ to 0.30 dex at M$_{\rm star} \gtrsim 10^{10.5}$ M$_{\odot}$. The
scatter decreases from $z=0$ to $z=5$ by 0.05 dex at M$_{\rm star} \gtrsim
10^{10}$ M$_{\odot}$ and by 0.15 dex for lower masses. We show that the scatter
at $z=0.1$ originates from a combination of fluctuations on short time-scales
(ranging from 0.2-2 Gyr) that are presumably associated with self-regulation
from cooling, star formation and outflows, but is dominated by long time-scale
($\sim 10$ Gyr) variations related to differences in halo formation times.
Shorter time-scale fluctuations are relatively more important for lower-mass
galaxies. At high masses, differences in black hole formation efficiency cause
additional scatter, but also diminish the scatter caused by different halo
formation times. While individual galaxies cross the main sequence multiple
times during their evolution, they fluctuate around tracks associated with
their halo properties, i.e. galaxies above/below the main sequence at $z = 0.1$
tend to have been above/below the main sequence for $\gg1$ Gyr.
