In the Mallet locomotive, there are two powered [truck (railway)|trucks]. The rear is rigidly attached to the main body and boiler of the locomotive, while the front powered truck is attached to the rear by a hinge, so that it may swing from side to side. The front end of the boiler rests upon a sliding bearing on the swinging front truck.
Mallet's original design was a compound locomotive, in which the steam is used twice in first a set of high-pressure cylinders, and then a set of low-pressure cylinders. This confers certain thermodynamic advantages, and also worked well with the Mallet design. Steam was fed from the steam dome down to the aft, high-pressure cylinders - the exhaust steam from those being fed forwards in a pipe with a swivelling joint to the forward, low-pressure cylinders. The exhaust steam from the larger low-pressure cylinders is exhausted through a slit in the sliding bearing in the top of the swivelling truck and thus to the smokebox above, and the blastpipe (US: exhaust nozzle) and chimney (US: stack).
Purists consider only compound locomotives to be true Mallets, but especially in the United States many non-compound ('simple') locomotives of a similar pattern were built. Unfortunately no good name for this design ever emerged, and they tend to get called 'Mallets' nonetheless, or 'articulated' which is a little too non-specific. Unlike the case of the rigidly-framed locomotive, the Mallet design is actually simpler as a compound, and complex as a simple, since then steam pipes and exhaust piping is needed for both pairs of cyinders.
Mallet's original design was intended to allow a medium-size locomotive to better negotiate the tight curves of a narrow gauge railway, but the Mallet design grew to enormous size in the United States, where it was used to permit locomotives to be built to sizes impossible with a single, rigid frame.