The ferric chloride forms a complex with the phenol, provided they are both very dilute, and the complex, being a charge-transfer compound, happens to give a very strong spectral signal in the visible, therefore it acts as a colour test for phenols, although not every phenol gives it. If it does give a positive, and you know they are common phenols, you can get a reasonable idea which phenol it is from the colour. Iron salts often do this, and if you add ferrous sulphate to gallotannins, you can make the type of ink that was very popular for some time. Ferric chloride is not a recommended test for phenols, in part because not all phenols react, but also in part because it is a somewhat sensitive test, i.e. you have to do it right for it to work. Right involves pH and concentration. If the solution is too concentrated, the ferric oxidises the phenols, leading to the formation of free radicals and phenolic coupling.