$\displaystyle \pi = \sum_{k = 0}^{\infty}\left[ \frac{1}{16^k} \left( \frac{4}{8k + 1} - \frac{2}{8k + 4} - \frac{1}{8k + 5} - \frac{1}{8k + 6} \right) \right]$
How does the BBP formula for digits of $\pi$ works exactly? Why does it use "interbase" math (hexadecimal and binary)? They don't seem to be related to $\pi$ in any way, which is just the ratio of the circumference and the diameter of a circle.
First note that the BPP formula does not compute the digits of $\pi$ in base 10, but rather base 16 (hexadecimal). Roughly, the factor
$$ \left( \frac{4}{8k + 1} - \frac{2}{8k + 4} - \frac{1}{8k + 5} - \frac{1}{8k + 6} \right) $$
corresponds to the $k$th hexadecimal digit after the decimal place, which is clear enough given that it is sitting next to the factor $1/16^k$.
For everything else, including a rigorous derivation of this formula there is the charming article "The Quest for Pi" by Bailey, Borwein, Borwein and Plouffe.