This paper presents a cognitive theoretical framework for the learning of mathematics which has generic implications for other disciplines. The framework has been developed using a combination of established theories about learning and the authors' research into the understanding of some specific types of learning. It is based on the integration of the structure of mathematics as a discipline with the work of Piaget, Skemp, Davidov and others. The key aspect discussed is the role of abstraction and generalisation in both forming mathematical concepts and learning mathematical procedures. Analysis indicates that there are at least two different types of generalisation, the combination of which provides a powerful tool for learning. The paper concludes by analysing some of the authors' recent research in light of the framework, showing how it provides practical guidelines which can be adapted to varying contexts.