How a piano's soft pedal works?

When you press the soft pedal it puts a piece of cloth over the strings in the piano, so that when you play it produces a soft, muffled sound. If you don't know how a piano works, then:

When you press the keys on the piano, it activates some hammer/s inside the piano, which taps on the strings inside. So therefore, when you use the soft pedal, it would make a muffled sound because the cloth covers the strings.