There are two revolution joints: vertical one between blue fork and green base, horizontal one between blue fork and orange wheel. Their offset distance is A.
When the caster is moved and the wheel is not facing the correct direction, the offset A will cause the wheel assembly to rotate around the axis of the vertical shaft to follow behind the direction of movement.