Purpose of the capacitor which is placed in parallel to collector and emitter of the transistor?
Most likely it is for damping the inductive kickback from the external speaker. There is no other mechanism for handling it, such as diode between speaker pins.