Why does the piano have its familiar curved shape?
The piano is actually a stringed instrument so when you hit a key on the piano keyboard it sets a hammer in motion and the hammer strikes a string. The string then vibrates and transfers its vibration energy to the sound board and the sound board radiates to the room. The piano has 88 keys and each key produces a different pitch. To control this pitch you have to control the frequency of the string that is associated with the key. Each key has a string or multiple strings that produce its sound and you want to be able to build the piano such that the different strings associated with different keys vibrate at the different frequencies. There are three ways in which you can control the frequency of a string: by varying the tension of the string, the mass or density of the string and the length of the string.
Tension
The way piano is built the strings are already at maximal tension. Each string and the piano has a tension which is equivalent to about approximately 100 kilos and an entire piano has about 20.000 kilos of tension. This is pretty amazing considering how thin strings are, and it shows how advanced is the technology in terms of materials that carry this tension for decades and sustain thousands of hammer strikes. The strings are already wound at maximum tension so we don't have any room to play around with this parameter.
Lenght
If we take a very short string - about 6.25 centimeters - for the highest A (A 7). Every time we double its lenght we go down an octave. The lowest A (A 0) would be eight meters long. We are going to end up with unreasonably long pianos that would be extremely difficult to construct and also to be sold. Just varying the length of the string isn't going to really solve your problem. It's going to solve your problem for this initial part of the piano dealing with the high frequencies and this explains the curved shape at the side of the instrument.
Mass
Once you reach this sort of wall (because you don't want to go past a two meter or three meter piano) you have to vary the strings mass instead if you want to control its frequency and you want to keep going down the piano range of frequencies. Why not just have a completely flat piano with all of the strings having the same length and then just changing their mass as we go along? Because changing the mass isn't as good as changing the length. In other words you would rather have thin, very thin strings if you could do it or get away with it. Having to make them thicker to go down in frequency is actually a non-ideal solution. The more mass you add the stiffer they get and the more they deviate from the exact multiples of the harmonic series: stiffness distorts the perfect harmonics of your harmonic series. That’s why wound strings are used, so that a second string is coiled around a thin one, mass is added without adding a lot of stiffness.
Going back with this additional insight, we see why this shape comes about: you start out from the high frequencies using relatively massless strings (strings that are very thin and not stiff at all so you have nice harmonics), and you start increasing their length as you go down frequency until you reach a point where they just require too much length they would result in too large a piano and at this point you use mass, even if it is not an ideal solution. Grand pianos sound better than smaller grand pianos because they extend the length regime farther out so they don't have to pay as large a price using the mass of the strings.