My broad and beginner answer:
The first stage is a "class A" amplifier that provide some voltage gain. This gain is proportional to the transistor beta
. The second stage is an emitter follower and it is basically just boosting the current: it's voltage gain is about 1, but it allow you to drive the load of the speaker without affecting the first stage. The emitter follower also known as common collector, has a large output impedence about \$\beta * R_l\$\$\beta * R_{load}\$ and a low output impedence of about \$R_{load}\$ in parallel with \$R_{input}/\beta\$.