According to the crystaline theory , the difference in the solubilty of calcium sulphate dihydrate and hemihydrate causes the setting of these materials
As the dihydrate is less soluble unstable condition happens leading to the formation of nuclei of crystalization (at the molecular level) And precipitation of dihydrate molecules around it (begining of solidification)