Actually, agile software development improves quality by delivering on shorter development cycles. What's the point of spending 2 years developing a multi-million-dollar, fully-featured content management system when requirements change out from under you? Every piece that doesn't work as well in the real world as it does for QA will break all at once when you ship it out--welcome to beta software--and features will do what users wanted two years ago.
With agile development, you deliver in pieces. You do iterative development, producing a framework or basis upon which to build further components. You do incremental development, producing fully-functional components which you can deliver immediately for use. Further development on iterative components reveals defects and design deficiencies, and so you refactor, re-engineer, and adjust to meet requirements. Delivery of a working component generates user feedback, which allows you to detect and correct for defects and changes to requirements.
At every stage, you generate more knowledge. Producing each piece, iterating on each framework, and responding to each piece of user feedback generates information which is folded into the further parts of the project. Rather than dumping one piece onto the pile of shit-to-deliver-later and blissfully working on the next, you get told that the shit you just made isn't what we need, and you can reflect on that and the implications for the next piece of the project. That means each piece takes into account the failures encountered so far, and the final product delivers closer to actual requirements at delivery time.
Part of planning is applying knowledge you have. Agile project management allows you to generate new knowledge at every stage and roll that forward into planning the next stage. You can't apply knowledge you don't have.