Since the actual circuitry (microchip) that converts your files to sound is very similar in all players, the sound quality is mainly a function of the quality of the earphones. If you want, you can buy replacement ear phones for a cheap player if you don't like what you're hearing.
The most expensive players (the ones with the biggest capacity) store files on a miniature hard drive. Since this is a moving part it's much more susceptible to damage if dropped or jarred. Lower capacity players use flash memory (i.e. no moving parts to worry about).
But there are other features you should consider other than sound quality...
How many songs do you really want to store?
Do you want an FM tuner in it to listen to radio?
Do you want to use it as a voice recorder as well?
Do you want to listen to audio books? (surprisingly, some hi-end brands like Sony are not compatible with book services like Audible.com)
Once you've decided which of these features you want, you should select a player that appears durable and has a display and controls that let you get through those features easily.