DrS's post proves that the biggest variable, when comparing kit to AG is the brewer.
Therefore, if the brewer knows what he is doing on both accounts - then his AG brew will be better than his extract brew.
But a good extract brewer can (and will in some instances) beat an average AG brewer.
My worst 2 brews have been AG. They'd rate well below my worst 2 kit brews. The problem was the brewer (and specifically, lack of temp control exercised by said brewer).
But my best 2 AG brews defecate all over my best 2 kit brews.
The other brewer related variable is that an AG brewer (at least after his first couple of attempts) generally knows more detail about the process, than a kit brewer (why a mash works, how hops isometerize).
I feel (and I may be wrong) that this is, in part, because the process requires the knowledge, but more importantly, the decision (if well researched and considered) to go AG, means that a brewer accepts the time factor as being increased - namely, this is now a hobby (or obsession).
Because they accept the time factor - that is they are no longer brewing because it is a cheap and cheerful (convenient, time efficient) way to brew beer - they will take the extra care and do the extra research needed to produce a finer beer.
They've also accepted that a partial mash, extra hopping, etc that you need to trick up a kit beer to be a better beer takes as much time as AG, therefore, they are at the stage where quality is the zenith, not time & cost.
A brewer that sticks with kit brewing does so as a fear or time factor. They've made a trade-off that they are prepared to live with - that is, time (brewing and researching the actual process of brewing) and perceived cost (it's cheap!) vs quality (you need to research to get it) and perceived cost (isn't AG expensive to get into?).
Additionally, AG brewers' bad beers are generally 1. Because they are too experimental or 2. Lack of control over the same elements that can cause a kit brew to go bung (temp control, yeast handling, etc). It has proved the case with my poorer AG brews.
So my understanding of why kit beers are, as a rule, far worse (rather than a little worse) than AG beers is not the ingredients, but the brewer - and more importantly his mentality, reasons for brewing and probably his skills. Yes, fresh AG ingredients are better than kit - there's no doubt about it. However, an extract brewer with control over his processes will produce a better beer than an AG brewer that doesn't.
But, as a rule, an AG brewer will generally have a better process understanding (due to a desire to increase his knowledge in order to control that process) - it's the minority of AG brewers who go in blind.
Yes, there are idiots and incompetants on both sides of the fence, but those excepted, an AG brewer will accept time, quality control and end result as the fundamentals of his brewing, whereas the extract/kit brewer will accept cost and ease of execution as the fundamentals of his brewing. A kit/extract brewer that starts to see quality and end result as the fundamentals of his brewing, will inevitably move to AG brewing, because (as happened to me) the time to produce a good kit beer is the same as AG (and IMO - costs more), AHB exists as a font of knowledge to get into cheap AG brewing, so why not try it out? I did, it's why I kicked 11 years of kit/extract 2 years ago, and plan never to go back.