Water carries silica from sandstone into voids and cracks, such as those found in fossils or natural wood cavities. As the water evaporates, the silica deposits remain, gradually creating opal.