A piano key, when hit with your finger, causes a hammer to hit a string in such a manner as to set the string vibrating. Most of its vibrating energy will be concentrated in its fundamental frequency, which for a vibrating string is the mode in which the ends of the string have zero displacement and the midpoint on the string has a displacement maximum.
However, the hammer that hit the string is not positioned to strike the string at its midpoint. In addition, the hammer strikes the string with a blow that is sudden enough to cause the strike point on the string to bend before the rest of the string has the opportunity to be set into vibratory motion all along its length. As pointed out by Stafusa, the plucking excitation is nonsinusoidal and hence contains all sorts of frequency components which are available to displace the string.
This means that while the string is vibrating along its entire length at its fundamental frequency of resonance, simultaneously there will be other vibrations traveling back and forth along the string's length with wavelengths much shorter than that of the fundamental. These waves quickly equilibrate and form up into standing waves with frequencies higher than the fundamental.
The first overtone, for example, has displacement minima at the endpoints of the string and an additional one right at the string's midpoint. This yields an "overtone" at twice the frequency of the fundamental tone.
Similarly, the vibrating string will also exhibit overtones at even higher, integer multiples of the fundamental frequency. As long as a vibratory mode has displacement minima at the ends of the string, it will "fit" onto the string with a wavelength that is a fraction (1/2, 1/3, 1/4, ...) of the fundamental.
If you have a guitar or other stringed instrument handy, you can demonstrate this for yourself in the following way: pluck the string hard with your finger or a pick, and then lightly and very briefly touch the string exactly at its midpoint. This will damp out the fundamental but will allow the double overtone to ring; you then hear that tone which is one octave higher (2x the frequency) than the fundamental.
You can also pick out the higher modes of the string by experimenting with this finger-damping trick at different points along the vibrating string's length.