A cell crawls over a gel (sometimes viscous, sometimes elastic) and decides on its own when to speed up. It doesn't just glide: its internal chemical motor (noise in gene expression can affect the production of 'fuel') pushes the leading edge, while the rear detaches from the substrate. It's like a person walking on sand, clay, and asphalt: the stride naturally becomes shorter or longer. This phenomenon has been named durotaxis — movement depending on substrate stiffness.
The researchers assembled a mechanochemical model: proteins inside the cell respond to how much the cell is stretched, and conversely, chemistry changes cell shape. A curious thing emerged: cell speed doesn't increase indefinitely with stiffness. Initially, on soft surfaces, it barely crawls; on intermediate ones, it speeds up; and on very stiff ones, it slows down again. There's a 'golden' stiffness at which the cell races fastest. Moreover, on surfaces slightly softer than this golden mean, the cell doesn't turn for longer: its memory of previous steps (feedback from mechanics to chemistry) helps it hold course. It's as if, when sinking into sand, you remember the effort and then walk straight for a longer time.
Some cancer cells use durotaxis to 'escape' into stiffer tissues and form metastases: they literally seek out harder ground.
In Peter Watts's novel Blindsight, alien cells re-engineer their mechanics to suit any environment — almost like our cells, but without a golden mean.