The black keys on a piano are used to play sharps and flats.. They help to create a wide range of musical sounds and expressions.