Peening is the process of expanding the shank of a rivet such that it can no longer slide out of whatever material it is inserted into.
The process involves striking the exposed end of the shank with a hammer. Ideally a mushroom-like shape is formed, rounded in three dimensions.
Sometimes it is desirable to achieve a mere loose connection of two objects. In this case, care must be taken not to strike too hard too much. Other times, a solid, immovable connection is desired, upon which the exposed rivet shank may be flattened completely.
How to Peen a Rivet (Forth Armoury)