The definition of $a^x$ is $$a^x=e^{x\ln(a)}$$
when $a>0$ and $x\in \Bbb R$.
The reason why we can't use this definition for negative $a$'s is somewhat obvious: the logarithm function is not defined for negative numbers.
Well. It could be defined, but there is a choice to be made, which essentially boils down to: is $\ln(-1)$ equal to $i\pi$ or $-i\pi$ (or $3i\pi$, or...)? If you choose e.g. $\ln(-1)=i\pi$, then you will have $\ln(-3)=\ln(3)+i\pi$, and so on for all negative numbers.
In general this choice is going to make a difference regarding the result of $x^x$. For instance $$\left(-\frac{1}{2}\right)^{\large\frac{1}{2}}=e^{\large\frac{1}{2}\left[\ln\left(\frac{1}{2}\right)+i\pi\right]}$$
is not the same as $$\left(-\frac{1}{2}\right)^{\large\frac{1}{2}}=e^{\large\frac{1}{2}\left[\ln\left(\frac{1}{2}\right)-i\pi\right]}$$
because $$e^{\large \frac{i\pi} 2}\neq e^{\large -\frac{i\pi} 2}$$
They differ by a $-$ sign, which is somewhat expected because the two expressions above are both supposed to be a square root of the same number, which is $-\frac12$.
However, in the very special case when the exponent is an integer, then the result does not depend on what choice you make for the logarithm. The definition $a^n=e^{n\ln(a)}$ will output the same result for any choice of logarithm extension, because two different logarithms differ by $2i\pi$ and when $n\in\Bbb N$, $e^{n\cdot 2i\pi}=1$. This unique output, as you would expect, is equal to $$\underbrace{a\times\ldots\times a}_{n\text{ times}}$$