If you shake a can of mixed nuts for a few seconds, the largest nuts come to the top. The spaces between nuts are not big enough for small nuts to fall through, but the small nuts end up on the bottom and the large ones on top anyway. Shaking creates momentary gaps in the mixture; small gaps occur more often than large ones.
Then the nuts are sorted by gravity. As the can shakes, the large nuts frequently move aside far enough to allow a small nut to fall into the space beneath. This happens much more often than the reverse process, in which several small nuts happen to make a gap that one large nut can fall into.
Every time a large nut moves far enough to allow a smaller nut to fall into a gap beneath it, that large nut ends up resting on top of the smaller nut. Over the course of several seconds of shaking, the large nuts slowly move up.
This is not only an amusing kitchen observation, but something with practical usefulness.
In many parts of the world, construction workers separate gravel from sand by shaking the container. Coarse gravel comes up to the top.Manufacturers can exploit the tendency of large particles to move up when they need to make a mixture of particles of different sizes, in pharmaceuticals, glass making, and paint making. They can put large particles into a container first, then add smaller particles on top. Shaking the container for the right amount of time causes the large particles to move up until they're evenly distributed through the mixture.