This American Life has a wonderful segment than explores this. If you're like me, you'd think it was a pretty dull topic - not so. The story behind one storyteller's journey to find out where his stuff came from is absolutely riveting. Listen to it here.
Like any good story, it raises more questions than it answers. Especially, because when it comes to the software side of things I have a fairly firm grasp about how it's created. But I'm clueless when it comes to hardware.
Seriously, try listening to the story for a few minutes - I'm sure you'll be hooked.