An interesting and useful property of some malleable metals, including aluminum, steel, stainless steel, copper, silver, and gold, is that as it is worked the metal becomes harder and more prone to brittleness - work hardening - but this property can for the most part be reversed by heating to an appropriate temperature, called annealing.
Counterintuitively, the regularity of a metal's crystalline lattice is what makes metals malleable. This lattice property in many other substances, including diamonds, is what makes those other materials super hard and brittle. With metals, the lattice can be dislocated when some form of pressure is applied to the atoms, and they dislocate one after the other along a lattice line, like a wave. This allows the metal to plastically deform, because one layer after another shifts. The lattice remains, but minutely altered. As these alterations occur, flaws develop, making the dislocations more difficult to achieve, thus hardening the metal.
Annealing allows the crystal deformations to reset into clean lattices again, removing the flaws, while still maintaining the complex shape of the object.
If you want to watch an amazingly good explanation of what makes many metal crystals malleable, watch this fascinating video by AlphaPhoenix: