How do string instruments produce sound? String instruments produce sound through the vibration of the string, which in turn vibrates the air molecules around it, producing a reaction that your brain interprets as sound. The length and thickness of the string will determine the vibration it makes, and different vibrations make different sounds, which explains why various strings and finger positions create a variety of tones.

So, knowing how string instruments produce sound is pretty simple. You touch the strings of these instruments - like a violin or a viola. The strings that you have touched create vibrations, affecting all of the molecules in the area around those strings. These vibrations then create the sound. This way in which string instruments produce sound is thus very similar to the way anything else - like your voice - produces sound.
To fully understand the process of how a string instrument produces sound, it is helpful to have a basic grasp of sound energy itself. The main concept to know is that the air is made up of air molecules, pressed together and surrounding everything.
The movement of an object, whether it’s a glass breaking or a string on a violin being plucked, causes the air molecules around it to move. Just like putting your hand into water causes ripples, the molecules around the object are displaced. However, because air molecules are so tightly packed together, there is no actual movement that takes place. The molecules actually vibrate.
Vibrating air molecules cause the molecules around them to vibrate, and this acts as a chain reaction, spreading out in all directions. A very drastic movement made by a big object will create a sound that can be heard further away, because the vibrations will be more intense and will create longer waves. This is like the difference between throwing a pebble into a lake – and throwing a boulder into the same lake. The ripples created by the pebble will die out much faster than the huge interruption by the boulder.
So what happens then? Vibrating air molecules, when they hit the human ear (or dog ear, or cat ear, or the ear of any creature with the ability to hear), create a vibration inside the ear. This is finally interpreted by the brain as what we know as a sound.
Different tones are created by different objects moving in different ways. To go back to the metaphor, throwing a stone into the lake will create one type of ripple, and throwing in a stick will create another. These different “shapes” of ripples are interpreted by us as various pitches and frequencies due to the various “types” of sound waves they create.
This is why the smaller, thinner strings of a string instrument produce a different tone than the thicker ones. It also explains why different finger positions on the instrument change its pitch: by putting your finger onto the string, you are shortening or lengthening the string, thus affecting how it vibrates and, in turn, the vibration it causes on the air molecules around it.
So, now you know how sound is produced by string instruments.