As you said, this is a matter of definition, but this choice is not random. Here is a short explanation why mathematicians chose this definition.
If you define exponentiation for $a\in \mathbb Z^+$ and $b\in \mathbb Z^+$ using repeated multiplication, or define it recursively as
$$a^1=a$$
$$a^{b+1}=a\cdot a^b$$
Then the following fundamental property follows:
$$a^x\cdot a^{y}=a^{x+y}$$
In order to define $a^b$ for $b\in\mathbb Z\setminus\{0\}$, we may simply assume that this property holds for all $x,y\in\mathbb R$. If we take this to be true, then we may deduce the value of $a^0$, since
$$a^0\cdot a^{b}=a^{b}\implies a^0=1$$
From this it would follow that
$$a^x\cdot a^{-x}=a^0=1\implies a^{-x}=\frac{1}{a^x}$$
which is the proposition that you are wondering about.