The principle behind Perls' staining involves the reaction between ferric iron and potassium ferrocyanide in an acidic environment. The ferric iron reacts with the ferrocyanide to form an insoluble blue compound, ferric ferrocyanide, also known as Prussian Blue. This reaction is highly specific for iron and does not stain other elements or compounds.