Explaining the simpson's diversity index
That's an estimator for Simpson index,
$$ \sum_i p_i^2 $$
where $p_i$ is the probability that $i$-th species is sampled.
This is sum of the probability that two independent samples are from the same species.
There are multiple ways of estimating this quantity from observations $n_i$.

When $n_i$ is small,
$$\hat{p} = \frac{n_i}{N}$$
is unbiased but has high variance, and plugging it in $\hat{p}$ to the definition would also have high variance. (Note that this is equivalent to sampling with replacement.)

If one uses sampling without replacement formula,
$$\hat{p^2} = \frac{n_i}{N} \cdot \frac{n_i-1}{N-1}$$
then, the resulting estimator is
$$ \sum_i  \frac{n_i \cdot (n_i - 1)}{N \cdot (N - 1)}$$

Note that both estimators converge to Simpson index for $N \to \infty$.
But of course, there aren't infinite number of samples, usually.