I find it easier to use geometric notation, so let $X = Spec(S)$$X = \mathrm{Spec}(S)$, $Y=Spec(R)$$Y=\mathrm{Spec}(R)$, and $\phi: X \to Y$ be the morphism corresponding to $f$. We have adjoint functors $$ \phi_\ast : S-mod \to R-mod: \phi^\ast. $$$$ \phi_\ast : S\text{-}\mathrm{mod} \to R\text{-}\mathrm{mod}: \phi^\ast. $$
Consider the (beginning of the) Cech simplicial set correponding to the map $\phi$.
$$ \ldots X \times_Y X \rightrightarrows ^{\widehat{\phi}_1} _{\widehat{\phi}_2} X \stackrel{\phi}{\rightarrow} Y $$
(sorry for the bad latex). It might be helpful to have in mind the example where $X$ is an open cover of $Y$, so that the space $X\times _Y X$ is consists of double intersections.
First of all, note that the structure of being a comodule for the coring $S \otimes_R S$ is a map
$$M \stackrel{a}{\to} M \otimes _S (S \otimes _R S) \simeq M \otimes _R S \simeq \phi ^\ast \phi _\ast M$$
satisfying the usual conditions. You may notice that the functor $\phi^\ast \phi_\ast$ has the structure of a comonad, and indeed, being a comodule for $S \otimes_R S$ in the category of $S$-modules is the same thing as being a comodule (aka coalgebra) for the comonad $\phi^\ast \phi_\ast$.
By base change, we have $\phi ^\ast \phi_\ast M \simeq \widehat{\phi}_{1\ast} \widehat{\phi}_2 ^\ast M$, so by adjunction, a map $a$ as above corresponds to a gluing map
$$\widetilde{a}: \widehat{\phi}^\ast _1 M \to \widehat{\phi}^\ast_2 M$$
i.e. a map
$$ M\otimes_R S \to S \otimes_R M$$.
This is the basic mechanism of the correspondence between comodules for $S \otimes _R S$ and the more down-to-earth notion of descent data. One can check that the conditions for $a$ to define a comodule correspond to the cocycle condition for the gluing map $\widetilde{a}$.
If the map $\phi$ is actually nice enough for descent (e.g. faithfully flat), then descent is a concequence of the Barr-Beck theorem: an $S$-module $M$ which is a comodule for $\phi^\ast \phi_\ast$ descends to an $R$-module $N$.
As you are a homotopy theorist, I should note that if you want to do this with complexes of modules (or more fancy things), then you will need the entire Cech simplicial set $\mathcal C(\phi)_\bullet$. Then, the data of being a comodule for $\phi^\ast \phi_\ast$ will be equivalent to being a simplicial module on $\mathcal C(\phi)_\bullet$.