It works due to the non-linear relationship between voltage and current in those two diodes. One clips the top half of the output waveform and the other clips the lower half of the waveform. The transistor is just an amplifier that would normally produce several volts p-p (without the diodes being there) for a few tens of milli volt at the input.
- R1 is a collector load to develop the output voltage across
- R2 both biases the base and provides a little negative feedback (gain regulation and dc offset control).
- R3 isn't there
- R4 probably isn't needed - it just discharges the output capacitor C2.
- C1 stops DC settings on the base being affected by the output impedance of the thing connected to the input.
- C2 removes DC content on the collector so that the two diodes clip symmetrically.
Bear in mind that I've given a blow-by-blow account of all the components and I can envisage a trail of questions and answers for each component - may I suggest you google the things I've told you to prevent a massive trail of comments and further comments.
To that end I've linked a tutorial about BJT transistors for you to digest. Take note that your BJT amplifier is a common emitter type (covered in the tutorial): -
Here's another site that discusses the feedback your circuit uses (R2 in your diagram): -