Depends on what you have. I've never had any onboard audio solution that didn't produce very audible buzz on line-out and nigh useless headphone output (microphone input not even worth mentioning).
You might have been unlucky? The last dedicated sound card i bought was about 15 years ago and since then over a few builds (and a few laptops) i've never had an issue with sound. I've also just used stereo rather than multiple speakers. Even running my PC sound over HDMI to the TV (and it's internal speakers) has good sound.
Now IF i was wanting to make music it would be a different story and i'd invest in decent (sound) hardware for that.
For just playing games or watching films onboard has been good enough for a while and you're better off getting decent speakers if anything.