Strings of different lengths and tensions hit by small hammers produce the sounds of a piano you are likely familiar with. Like other instruments that use strings to produce sound, such as violins and guitars, the pitch of the sound depends on the length of the string and the amount of tension applied to the string. However, pianos differ in that there is no need to manually change the length of the string to create a different pitch.
When you hit a key on the piano, you cause one of the hammers to hit a string within the piano that is tuned to a certain note. The action of the piano allows your keystrokes to instantaneously make a sound. When you press a key on the piano, the hammer strikes the string and then comes back up. Then, when you release the key, the string is damped and the sound stops.
Original pianos and the predecessors to the piano used different methods of bringing the sound from the string. Early versions of the piano either plucked or hit the string and held it in a certain place to create the sound; methods that would not have resulted in much control over the dynamics of the sound or the amount of time it can be heard.
Today's pianos have 88 keys that each result in a certain note being played. If you can play one piano, you should be able to play any piano because the keys and the resulting notes are in the same location. However, not all pianos are created equally in terms of the quality of sound. Cheap pianos can be had for hundreds of dollars, while top of the line pianos cost many thousands of dollars.
Due to the fact that striking a string does not create that loud of a sound, pianos are outfitted with special soundboards, which are concave pieces of wood that re-transmit the sounds from the strings by harnessing the vibrations better. While it may appear as if the keys and strings do must of the work on the piano, the quality and position of the wood is just as important.