Living and growing cells can be fed isotopes of atoms that are heavier than those they normally encounter. As a result, all the molecules they make (proteins, polysaccharides, and of course, their DNA molecules) are also heavier and denser than normal.
These artificially "heavy" cells can be gently broken open, their "heavy" molecules can be extracted, cleaned up a bit, and then placed into a solution of cesium chloride, which is itself a heavy, dense molecule. When this mixture of DNA molecules and the solution of heavy cesium ions is rotated very, very fast in an ultracentrifuge, the cesium ions form a gradient of density; light density at the top of the tube and heavy density at the bottom of the tube.

The DNA molecules also move in the massive gravity field generated by the centrifuge. They slowly sink through the cesium solution to the place in the gradient of cesium ions where their density is the same as that of the local concentration of cesium ions. Light molecules stay near the top, and heavier, denser molecules sink lower and lower.
It's a bit like water, cork and lead. Cork is less dense than water, so it floats whereas lead is much more dense than water, so it sinks to the bottom of the vessel. Molecules which are less dense than the local cesium ion concentration in the gradient float upwards, whereas the molecules that are more dense than the local cesium ion concentration sink downwards.
In this way it is possible to separate out substances if different density. Imagine a mixture of tiny particles of cork and lead; how could you easily separate them?
The answer would be to pour them into water; the cork particles would float and the lead particles would sink. This method makes use of the different densities of the cork, water and lead. Separating molecules of different density in cesium chloride gradients makes use of the same principle.
This technique was used to investigate how DNA molecules were replicated by living cells.