横财 often implies money obtained through illegitimate or unexpected means. It carries a slightly negative connotation in most contexts, suggesting the money wasn't earned through honest work. Compare
意外之财 (unexpected fortune) which is more neutral. Note the pronunciation: hèng (fourth tone) — this is the 'unexpected, sideways' reading of
横, not the everyday héng.