What are the mechanics by which Time Dilation and Length Contraction occur?

The right way to think about this is geometry--- but the geometry mixes up space and time. I wrote some answers about this here: Einstein's postulates ↔ Minkowski space for a Layman and here: Help Me Gain an Intuitive Understanding of Lorentz Contraction and if you read these first, you can easily understand the effect.

The Lorentz contraction is no more mysterious than the following everyday phenomenon: when you place a meterstick parallel to the edge of the table, it marks off a part of the edge which is one meter long. If you rotate the meterstick so that it isn't parallel to the edge anymore, and look how far along the table the stick extends, it extends less distance. You can then ask "what is the mechanism that causes the $x$-distance of the ruler to shrink when it is rotated into $y$?" And the answer, if given in terms of the mechanism of cohesion of the atoms, would be ridiculous. It is obviously a property of rotations, of space, not of the forces in the ruler.

But you can ignore this, and ask--- if I have a line of particles held by elastic forces, why does their $x$-separation shrink when they are tilted? The answer would then be "because the equilibrium position is given by the solution to the equation:

$$\Delta x^2 + \Delta y^2 = a^2$$

When you restrict $\Delta y$ to be zero, you get one separation, but when you make $\Delta y$ proportional to $\Delta x$ with a different constant of proportionality, you get a different separation. If you don't believe in rotational invariance, you can consider this to be a nontrivial physical effect--- "$x$ contraction" in response to "$y$-tilt"--- caused by the mysterious $x^2 + y^2$ dependence of forces inside a ruler.

If you have a ruler tilted at a slope of $m$, then $\Delta y= m \Delta x$, and $$\Delta x = {a\over \sqrt{1+m^2}}$$ This is obvious in a picture--- the tilted ruler is reduced in horizontal length by this amount.

To understand relativistic length contraction, a second geometric analogy is useful. Consider a prison-stripe fabric placed on the table, so that the stripes are along the $y$ axis with separation a between the edges. If you rotate the fabric so that the stripes make a tilt of slope $m$ with respect to the $y$ axis, and you make a line parallel to the $x$-axis what is the distance between the intersections with the stripes?

In this case, the $x$-axis line will intersect the rotated stripes at a longer distance, so that the stripes will change color every $$\Delta x = a\sqrt{1+m^2}$$ When the rotation angle approaches $90^{\circ}$, the slope blows up, and you get an infinite distance, reflecting the fact that the stripes are now parallel to the $x$-axis.


Relativistic analogs

In relativity, the atoms make lines in space-time, and their equilibrium position is determined by the "minimum" relativistic distance between the lines (I put minimum in quotes, because it is a maximum, but it is analogous to the Euclidean distance between two lines, and it is only a maximum because of the minus sign in the relativistic pythagorean theorem), so that if the atoms at rest have a $x$-separation of $a$, and the force between them is relativistically invariant, when they are moving, the distance between them has to obey

$$ \Delta x^2 - \Delta t^2 = a^2 $$

where $\Delta t$ is now nonzero. The invariant distance between the lines is given by the "shortest" (actually longest) line linking them. This shortest line is the moving observer's x axis, which is tilted upward in a spacetime diagram by a slope v, just like the moving observer's t-axis is tilted by a slope of v to the right. The tilt of the axis gives that for the two space-time points at separation a, $\Delta t = v \Delta x$, and the result is $$ \Delta x = {a\over\sqrt{1-v^2}} $$ This gives the $x$-distance between two endpoints on the moving ruler which are simultaneous in the ruler's frame. This distance is longer by a factor of $1\over \sqrt{1-v^2}$, just like in geometry it is shorter by $1\over \sqrt{1+m^2}$. The argument is exactly the same, except for the minus sign in the pythagorean theorem.

This thing is not usually explained in relativity books. It is the un-named phenomenon of "length dilation", and it is the direct analog of the shrinking of the $x$-length of a tilted ruler. This is not length contraction, which is like the prison stripe fabric.

When you have a moving ruler, you are usually not interested in the $x$-distance of two points which are simultaneous for somebody riding along with the ruler, but in the $x$-distance of two points which are simutaneous to you. To understand this case, consider a bunch of rulers end to end. These make a collection of lines parallel to the time axis which represent the endpoints in space time.

Now if all these end-to-end rules are moving, their space-time diagram is tilted to make a slope $v$ with the time axis. You then ask how often the $x$ axis crosses these tilted lines. The relativity formula is exactly the same as the geometry formula, except for the minus sign in the pythagorean theorem:

$$ \Delta x = a \sqrt{1-v^2}$$

so that the prison stripes (ruler ends) are closer together by $\sqrt{1-v^2}$, just as in geometry the prison stripes are further apart by $\sqrt{1+m^2}$.

In these formulas the units of length and time are chosen to make the speed of light $c$ equal to $1$. Any other choice would be as ridiculous for relativity as measuring the $x$ coordinate in feet and the $y$ coordinate in meters, and trying to describe a rotation.