The basic idea is that mapping, i.e. a function $f$ from $[n] = \{1,\ldots,n\}$ to $[n]$ can be represented in terms of "basins of attraction". Create a digraph by joining $i$ to $j$ if $f(i)=j$. In this digraph, each connected component will contain a unique directed cycle, and each vertex $i$ of the cycle will be the root of a tree all of whose edges are oriented towards $i$. It is then possible to code the structure of the cycle-plus-trees in terms of a lattice path, with height corresponding to distance from the cycle.
When the underlying mapping $f$ is a uniformly random mapping, the resulting lattice path, suitably interpreted and after rescaling, converges to (the absolute value of) Brownian bridge.