`FullSimplify[ Sqrt[2 \[Pi]] InverseFourierTransform[1/(x^2 - a^2), x, p], Element[a, Reals]] `

Gives the output

`-((\[Pi] Sign[p] Sin[a p])/a) `

But

$ \int_{-\infty }^{\infty } \frac{e^{-i k x}}{x^2-a^2} \, dx$ is not a defined integration. Mathematica also returns undefined as answer if you compute it.

So, I am trying to understand how does Mathematica calculates that Fourier transform of the non-integrable function.