Train rails only look like they aren't connected to anything. If they truly sat loose on the ground, the summer heat would violently warp miles of steel into chaotic zig-zags.
Instead, they are integrated into a massive, interlocking system designed to hold them straight against enormous thermal and mechanical forces. The steel rails are anchored to perpendicular beams called ties or sleepers, which are typically made of wood, steel, or reinforced concrete. Heavy-duty metal fasteners—like spikes, bolts, or tension clips—pin the rail down, locking the track at a precise, unvarying width known as the gauge. These fasteners stop the rails from rolling over or shifting outward when a locomotive leans into a curve.
The ties themselves are buried in ballast, a thick bed of crushed rock. While it might look like loose gravel, ballast is specifically engineered with jagged, angular edges that interlock under pressure. This creates a rigid matrix that absorbs the weight of the train while allowing rainwater to drain. More importantly, the ballast grips the ties, preventing them from moving side-to-side or creeping lengthwise down the line.
This restraint system is pushed to its absolute limit by modern track design. Historically, tracks were laid in short sections with gaps between them to allow for heat expansion, which caused the familiar "clickety-clack" sound. Today, railways use continuous welded rail, fusing tracks into seamless ribbons that can stretch for miles. With nowhere for the heated metal to expand linearly, the rails build up immense internal stress on hot days.
The only thing keeping a continuously welded rail straight is the sheer holding power of the ties and the ballast. When that system fails—whether from extreme heat, degraded ballast, or missing fasteners—the built-up thermal pressure overcomes the track's restraints. The track violently buckles sideways, creating a severe horizontal warp known as a 'sun kink'.