The upper part of the white key of the piano is extruded (I don't know if anyone will get my point so I'll put a picture here)? Is it just for ornamental use or does it actually have a practical utility?
This style of key dates back to the earliest keyboards. My guess at the reason is because they were easier to make that way.
In fact making the keyboard itself was one of the most skilled operations in hand-building early instruments. Originally, all the keys in a keyboard were cut from a single plank of wood. The reason was that any warping caused by changes in humidity would affect adjacent keys in the same way, and therefore avoid the keys binding against each other. Of course with modern kiln-dried wood and moisture-proof treatments (not to mention replacing wood with stable materials like plastic) this is no longer such a big issue.
On some instruments (particularly clavichords) the main part of the key is often dog-leg shaped rather than straight, because the spacing of the strings is different from the spacing of the playing part of the keys.
Marking out and cutting all this accurately with hand tools is not easy, and a single mistake could ruin the entire keyboard!
The tops of the playing part of the keys were often made from different material (e.g. two different colours of wood, wood and ivory, etc) and the slight "overhang" conveniently disguises any minor errors in perfectly aligning the top and the body of the keys.
If you messed up when shaping the end of a key top by hand when creating a smooth playing surface, you only have to scrap that one key-top. If you messed up shaping the end of the complete key (for example by removing too much material) you might have to scrap the entire keyboard and start again because of the warping issue described earlier.
In early instruments, the key tops for the "white" keys were often made in two parts with different widths - a narrow part fitting between the "black" keys, and a wider part for the unobstructed ends of the keys. In this case it would be easier to finish the ends of the keys to a consistent shape (avoiding any sharp edges which the player would dislike) and then adjust the "joint" between the two parts of the key top to fit together perfectly for each individual key.
See the photo "detail of boxwood and ebony keys" here, for example.
On early instruments the end of the key body was often decorated by engraving, or cutting an "arch" on the underside. On instruments with more than one keyboard, the front of the keys was often beveled at about 45 degrees so that the upper keyboard protruded over the lower one, allowing more finger-room for the player.
While there doesn't seem to be any real reason to preserve this design with modern manufacturing techniques, there is no particular reason to get rid of it either - so like the human appendix, the tradition continues in piano keyboards even if it doesn't have much functionality! The "45 degree bevel" style is reproduced in some plastic keys for one-manual synthesizers - the only obvious reason would seem to be to use a bit less plastic, cutting the cost by a few cents.