Your correct on the cost of the headers/ports being much higher than most would think (certainly higher than the AVR).
However, the arduino products are not even close to being in the ball park of volume needed to purchase their own PCB manufacturing equipment, nor P&P, nor reflow, nor QA systems. Its all outsourced, probably through multiple layers (they list SparkFun as a manufacturer and I can almost guarantee they aren't doing any of the actual manufacturing either).
Sparkfun owns a pick and place machine:
http://www.youtube.com/watch?v=tn0EKtLOVx4
Presumably they're doing the reflow there too. No idea about the PCB manufacturing.
Adafruit is even smaller, I think, and they do their own QA:
I still contend that the Arduino is approximately decently priced when you consider that Arduinos are popular enough to not be put together by hand but niche enough to not be made by the millions at Foxconn.
http://www.bunniestudios.com/blog/?p=2407
It's a tour of the Arduino PCB manufacturing facility, with QA systems, and PCB manufacturing equipment.
He alludes to sending the stack of PCBs to the SMT facility, although he doesn't have a tour of that one on his site.
You can certainly have AVR applications that cost less than $20, but there is a fair amount of cost in producing a development board. (You say $30 but there are plenty of sub-$20 Arduino clones.)