By definition:
$$b^n = \underbrace{b \times b\ ... \times b}_{n \text{ times}}$$
Therefore we get our first identity:
$$b^{n+m} = \underbrace{b \times b\ ... \times b}_{n \text{ times}}\times\underbrace{b \times b\ ... \times b}_{m \text{ times}}$$
$$b^{n+m} = b^n b^m$$
Similarly, we can get our second identity:
$$\left({b^n}\right)^m = \underbrace{\underbrace{b \times b\ ... \times b}_{n \text{ times}}\times\underbrace{b \times b\ ... \times b}_{n \text{ times}}\ ... \times \underbrace{b \times b\ ... \times b}_{n \text{ times}}}_{m \text{ times}}$$
$$\left({b^n}\right)^m = b^{nm}$$
About how this applies to rational and irrational numbers you can read the Wikipedia page about exponentiation starting
here.
If you accept that and we define that ##y = \log_b x## if ##b^y = x##, then by our first identity:
$$b^{y_1}b^{y_2} = b^{y_1 + y_2}$$
$$x_1x_2 = b^{y_1 + y_2}$$
$$\log_b(x_1x_2) = y_1+y_2$$
$$\log_b(x_1x_2) = \log_b x_1+\log_b x_2$$
From there, if ##x_1 = x_2 = a##, then:
$$\log_b(a^2) = \log_b a+\log_b a = 2 \log_b a$$
And for ##\log_b(a^3)##, we get:
$$\log_b(a^2\times a) = 2\log_b a+\log_b a = 3 \log_b a$$
Or for the general case:
$$\log_b(a^x) = x \log_b a$$
As for the other case, we used the second identity:
$$a^x = \left(a\right)^x$$
$$a^x = \left(e^{ln(a)}\right)^x$$
$$a^x = e^{xln(a)}$$