  The box-ball system (BBS), introduced by Takahashi and Satsuma in 1990, is a
cellular automaton that exhibits solitonic behaviour. In this article, we study
the BBS when started from a random two-sided infinite particle configuration.
For such a model, Ferrari et al.\ recently showed the invariance in
distribution of Bernoulli product measures with density strictly less than
$\frac{1}{2}$, and gave a soliton decomposition for invariant measures more
generally. We study the BBS dynamics using the transformation of a nearest
neighbour path encoding of the particle configuration given by `reflection in
the past maximum', which was famously shown by Pitman to connect Brownian
motion and a three-dimensional Bessel process. We use this to characterise the
set of configurations for which the dynamics are well-defined and reversible
for all times. We give simple sufficient conditions for random initial
conditions to be invariant in distribution under the BBS dynamics, which we
check in several natural examples, and also investigate the ergodicity of the
relevant transformation. Furthermore, we analyse various probabilistic
properties of the BBS that are commonly studied for interacting particle
systems, such as the asymptotic behavior of the integrated current of particles
and of a tagged particle. Finally, for Bernoulli product measures with
parameter $p\uparrow\frac12$ (which may be considered the `high density'
regime), the path encoding we consider has a natural scaling limit, which
motivates the introduction of a new continuous version of the BBS that we
believe will be of independent interest as a dynamical system.
