This is a very simplistic (meaning ... bad design) circuit. But here's the explanation anyway --
When SW1 opens, the bjt Q1 gets base current through R1. This turns it ON.
Now when Q1 turns on, then Q2 base gets pulled low, and it also turns on suddenly.
This means that current starts flowing through the speaker.
Since the speaker has some impedance (resistor ~ 8 ohm ? 32 ohm ? and some small inductance), there will be a sudden voltage drop across this when Q2 conducts.
This voltage will get transmitted by cap C1 back to the base of Q1, and cause it to turn off. But this is only momentary, and after a short time, the whole cycle repeats.
So at speaker, you will get an varying (square?) voltage/ current profile, and cause it to make some sound.
However note that this circuit is very dependant on the specifications of all the components, and any one component being wrong can cause it not to work properly.
I suggest you find a different project to start with - this one could prove irritating.