The smoothness of the lunar topography is interrupted by mountains, craters, valleys, etc, and the lunar limb profile is known accurately from grazing occultations of stars. So in advance of the eclipse we have a fairly good idea which mountains and valleys will cause the beads to appear. While Baily's beads are seen for a few seconds at the central path of the eclipse, they are visible longer near the margins of the path of totality.
The diamond ring effect is seen when only one bead is left, a shining diamond set in a bright ring around the lunar silhouette.
Cosmas Damian Asam was probably the earlist realistic painter to depict a total solar eclipse and diamond ring. His painting was finished in 1735.