When a key is pressed, a hammer inside the piano strikes the strings from below. However, this only produces a soft sound.
One end of the strings is supported on bridges, which are attached to the soundboard. The vibrations of the strings are transmitted to the soundboard through the bridges, and a loud sound resonates as a result of the soundboard vibrating the air. The entire piano, notably the soundboard, vibrates to produce sound.