Seems to be my night for disagreeing with Cougar!
Oh no it isn't!
I found this to be the case, but the 30 pin connector to RCA is WAY better than the headphone jack to RCA - don't know why.
Thinking about it, there is a logic to that. Aside from the gain / line as others have said, the headphones will be analogue, the 30-pin may be digital? I can't immediately find confirmation of this either way, other than comments that the 30-pin to Lightning adapter contains a DAC which may imply that it might.
Still. Either of those may explain why the base connector might yield better results than the headphone jack. It doesn't really explain why it's "terrible" though. You're connecting an amplified source to a line in so buzzing might imply perhaps that your audio level is too low / high for the input, too high would distort and too low would mean you're amplifying more noise as well as signal; or as RichPenny suggests maybe there's a bad earth somewhere?