The purpose for learning history is to understand the cascade of events that led the world to where it is today. It isn't just about preventing past mistakes, but also to inform the present. Why is the middle East the way it is right now? Why does America have a Senate? Why does the town you live in even exist? History isn't the study of the past so much as it is the study of humanity, of the forces that drive people.
If you're in APUSH and all you're doing is memorizing facts, you or your teacher one (if not both) are doing it wrong.
History, especially at the AP level, should be about analysis and critical thinking. That's what history provides you with. There's a reason that a good pre-law major is history; you learn to research, analyze sources and facts, and process that into an argument. THAT's what learning history is about. Facts are important too, but that's just the surface.
You may be interested in this previous thread.