When you hear a note from a piano, you are actually hearing many tones at once. The dominant tone is the fundamental of the note, and that note is the main frequency of the note. It is caused by the entire length of the string vibrating in one plane. It is also the most dominant or noticeable component of the sound you hear. But, you can also hear higher order harmonics as well. these harmonics are caused when the string vibrates in "segments", with each section of the string vibrating around a "node" that remains fixed. Since each harmonic divides the string into different numbers of segments, each harmonic also has its own frequency. Here's how the string actually vibrates.
As a string vibrates, it vibrates in many ways at the same time. The whole length of the string vibrates, which creates the fundamental frequency. Also simultaneously, the string divides in half, called the second harmonic. The second harmonic vibrates simultaneously with the fundamental and makes a tone an octave higher than the fundamental. If you play a piano note and listen carefully, you can hear the second harmonic an octave higher. It sounds at the same time as the lower pitched fundamental.
Likewise, the string also vibrates around other nodes, dividing the string into thirds, fourths, fifths, and so on. When a piano string vibrates, up to ten or twelve audible harmonics are present. Strangely, ALL of these vibrations happen simultaneously. So a string doesn't really vibrate back and forth. It sort of wiggles and bends in many directions simultaneously as the higher order harmonics are created.
Each piano has a unique harmonic signature. Some pianos will accentuate some harmonics over others. This is why different pianos have differing tonal qualities. It is the harmonic content of the notes of a given piano that give it its unique sound. Usually, the more accurately the soundboard of the piano amplifies all of the harmonics of a tone, the more interesting it will sound.