Fisher’s exact test is a statistical significance test used in the analysis of contingency tables. Although it is valid for all sample sizes, in practice it is employed when sample sizes are small. The Fisher’s exact test is used when you want to conduct a chi-square test, but one or more of your cells has an expected frequency of five or less.
Remember that the chi-square test assumes that each cell has an expected frequency of five or more, but the Fisher’s exact test has no such assumption and can be used regardless of how small the expected frequency is.
Actually, Fisher’s exact test showed that the probability of obtaining any such set of values was given by the hypergeometric distribution.