Why do esters actually smell?
Dissenter is correct about aromatic compounds and that the basic requirement for a compound to be detected by smell is for it to be volatile enough to reach the nose. This is why things like dry salt don't really smell like anything. Once they reach the nose, things become more complex.

Why many esters smell fruity while most thiols smell rather unpleasant is a rather interesting question. Just as most sugars taste sweet, many molecules that have structural similarities also smell similar. Humans have about 350 different olfactory receptors. These are G protein-coupled receptors that change conformation when they bind a compound and activate a signal pathway that is eventually sent to the brain for processing. However, since we only have 350 different receptors and there are far more than 350 odoriferous compounds, there is not a one-to-one mapping of receptors to compounds—there isn't an "acetone receptor". Instead, olfactory receptors have partial and overlapping selectivity. Each receptor type responds to more than one compound, thiols with a certain general shape, for instance, and different receptor types can respond to some of the same compounds. A given compound then has a more or less unique pattern of receptor activation. All this information gets sent to the brain and is processed into the perception of smell. Compounds that have similar structural properties activate many of the same receptors, so they smell similar.