This is just how the guitar is played, but the difference is that since it is the finger and fingernail that is plucking the string, the guitarist can play louder or softer depending either on how deeply the string is pressed before releasing it, or how quickly it is attacked. Either way imparts more or less energy to the string, making the note louder or softer. On the harpsichord however, the mechanism prevents this. I do seem to hear that some harpsichordists seem able to accent chords and I wonder if it is through some subtle throwing of the key? In any case, this is a very limited effect.
The piano was invented specifically to overcome this limitation. The full name, pianoforte, literally means "soft-loud". Instead of plucking the string, a padded hammer hits the string. This was the invention of an Italian, Bartolomeo Cristofori around 1700. The mechanism needed to allow for a small movement of the key to result in a large movement of the hammer and to check the rebound and allow for quick repeated notes was quite complex. While Cristofori's action had most of the principles, others over the next hundred and more years refined the mechanism considerably. Here is what it looks like:
Incidentally, since the beginning of the "early music" movement, a need has arisen to find a term to describe these historic early pianos that distinguishes them from modern pianos. So we use the term "fortepiano", just reversing the word "pianoforte". Any time you see the word "fortepiano" you know that it is the early piano that is being talked about. Let's listen to some Mozart on one of the instruments from his time. Here is Malcolm Bilson playing a movement from the Sonata, K 333. Notice how much lighter and crisper the sound is from a modern piano:
One important innovation was by Gottfried Silbermann, who invented the damper pedal, which lifts all the dampers allowing all the strings to resonate sympathetically. One of the earliest pieces to take advantage of this was Beethoven's "Moonlight" sonata. Let's listen to the first movement on fortepiano played by Trevor Stephenson:
The piano underwent considerable development in the 19th century, becoming a louder and considerably heavier instrument. One consequence is that it can be very interesting to hear even a composer like Chopin on the instrument he preferred, one built by Sébastien Érard:
I have to bring this to a close now, so let me end with a modern piano and the kind of ferocious music it is capable of playing. Here is Grigory Sokolov with the last movement of Prokofiev's Sonata no. 7: