If you take the derivative of a function using the (derivative) power rule, then you can always reverse it using the antiderivative power rule, its mainly just a reverse of it.
Like if you were to take the derivative of x^2, then using the power rule it would be 2x^1 or just 2x. If you were to find the antiderivative of that using \frac{x^n+1}{n+1} (agh supposed to be x^(n+1) not (x^n)+1) then it would be x^2 again.
If you're asking how it works, the derivative power rule derives itself from the limit of \frac{f(x+h) - f(h)}{h} as h approaches 0. The antiderivative is a little more complicated and doesn't work in all instances (like when n=-1) so some other methods like natural logarithms need to be used.