The compound interest formula $A=P\left(1+\frac{r}{n}\right)^{nt}$ is usually used in examples where you are given a nominal annual rate and then calculate the accrued amount, where $\frac{r}{n}$ is the "monthly" rate.
e.g. nominal interest rate $= 5\% \,\,\text{p.a}, P = \$100 $ and this is compounded monthly.
So we say $ A= 100\left(1+\frac{0.05}{12}\right)^{12}=\$105.116...$
We have in fact earned $\approx5.116\%$ interest. This is what is called the "effective interest rate".
So which is the "correct" annual rate and what has $\frac{r}{n}$ got to do with $r$? Why do we say $\frac{r}{n}$ is the monthly rate when the "true" monthly rate would be in this example $\sqrt[12]{1.05}-1$, giving us an annual interest of $5\%$. I guess my question is really what logic would lead you to divide $\boldsymbol{r}$ by the number of compounding periods? I can't seem to understand the reasoning behind that. As in the example, the effective rate seems unrelated or somehow arbitrary compared to the nominal rate.
The naive answer would be if you have $5\%$ interest per year, you will get $\frac{1}{12}$ of this rate every month, but given that you know this will be compounded, why would you do this?
Apologies if this has been asked before, this is a question that has occasionally bothered me and I have never found an answer.