on what factor does the quality of sound depend?
Quality of sound (Timbre) is mainly determined by the harmonic content of a sound and the dynamic characteristics of the sound such as vibrato and the attack-decay envelope of the sound. It is different for sounds produced by different types of instruments. These factors depend on the type of the instrument, material medium used for producing the sound, temperature etc.
The sound quality of different electronic audio devices depends on the technology used for recording and reproduction of sound, bit rate, range of sound and the performance of the system.