Bertrand Russell's greatest pieces of philosophical writing could probably be said to be "The Principles of Mathematics", "On Denoting" and with Alfred North Whitehead "Principia Mathematica". There is however one sense in which it could be said that the russellian magnum opus is The Principles of Mathematics, from here on TPM.
TPM is, arguably, the culmination in print of a long process of thought and concern, philosophically speaking, of Russell's intellectual preoccupations from his adolescence, youth and maturity with questions relating to the foundations of mathematics. Ever since Russell read Mill in his adolescence he had thought there was something suspect with the Millian view that mathematical knowledge is in some sense empirical & that mathematics is, so to speak, the most abstract of empirical sciences, but empirical nonetheless. Though he lacked the sophistication at the time to propose a different philosophy of mathematics, his concerns with these topics remained with him well into the completion of Principia Mathematica. Logic and Mathematics were, by that time, seen as separate subjects dealing with distinct subject-matters; it came to be, however, the intuition of Russell (an intuition shared, and indeed, anticipated by Frege) that mathematics was nothing more than the later stages of logic. He did not come into this view easily; after a long period of Hegelianism and Kantianism in philosophy, in which Russell sought to overcome the so called antinomies of the infinite and the infinitesimal, etc; Russell saw light coming, not from the works of philosophers, but from the work of mathematicians working to introduce rigour into mathematics. Through the developments introduced by such mathematicians as Cantor and Dedekind Russell saw, or indeed thought he saw, that the difficulties in the notion of infinite and infinitesimal could be dealt with by solely mathematical methods, and it was through the continued development of formal logic by Peano and his followers that Russell saw the possibility of defining the notions of zero, number & successor in purely logical terms. Before all of these developments and ideas were put together by Russell and developed into the philosophy of mathematics known as logicism, he made several sophisticated though unsuccesful attempts at questions having to do with the foundations of mathematics, one such attempt is his "An Analysis of Mathematical Reasoning" (now in the Collected Papers). In TPM all of these developments are taken together with the formal logic Russell was developing following the steps of Peano, indeed the TRUE foundations of mathematics are for Russell: the calculus of classes, the propositional calculus and the predicate calculus. Of course, for Russell, the notion of class is a purely logical notion which is defined intensionally, by the comprehension axiom, rather than extensionally, by the enumeration of its members. This means that a class can be determined solely by a property which all of its members share. For example, the property of being blue determines the class of all blue things. The view that every property determines a class is what leads to Russell's paradox (more on this below).
Indeed, the book not only presents these developments, argues for them and introduces the reader to the theoretical and philosophical edifice of formal logic, but also with these tools Russell delves in an exploration of all or most concepts relevant in the mathematics of the day. As promised, he shows that Peano's primitives in the Peano-Dedekind axioms: zero, number & succesor, can be defined in purely logical terms (according to his view of logic which is not philosophically neutral). He gives a definition of cardinal number in terms of one-one relations betwen classes. Indeed, a cardinal number is just the number of a class of similar classes, that is, the number of a class is the class of all classes similar to the given class & two classes are similar if and only if there is a one-one bijection beween their members. For instance, the number '2' is the class of all couples and the term 'couple' can be further analysed through quantification & identity (thus the definition is not circular). With this, & Peano's axioms, he gets the natural numbers & shows that with the methods he proposes he can construct the whole of the real numbers, and that the concept of infinity can be dealt with through the set-theory of Cantor. Russell's theory of relations, a theory which made possible to deal with relations in formal logic as well as to refute the metaphysical views of Bradley and others, appears in the book. The problem of the unity of the proposition, as well as perennial difficulties in the philosophy of language, rear their heads. The chapter on "The Philosophy of the Infinite" is a tour de force for anyone interested in the philosophy of mathematics. Zeno's paradoxes are discussed with the new methods, yielding valuable insights. Russell even engages in a brief, yet sophisticated, discussion of the philosophy of matter towards the end of the book.
This book is quite long, but it is absolutely breathtaking in its depth, its subtle arguments, its sophistication and originality (for its time). The book already contains a philosophy of language and reference not all that different from that of Frege in "Sense and Reference", though less sophisticated, still capable on its own of dealing with definite & indefinite descriptions via the use of the denoting concept (this gives the theory enough resources to deal w both impossible & non-existent objects). As I said, it is thorough in its philosophical examination and explanation of mathematical concepts, and it delves into physics through the russellian investigation of space and time, as well as his incorporation of logicism into physics through rational dynamics.
Russell's paradox makes its first appeareance in this book, it has a chapter to itself. Given Russell's assumption that every property determines a class, one might ask, what of the property of not being a member of itself, a property which some classes have, like the class of humans, it is not a human & therefore not a member of itself. But then, what of the class of all those classes which are not members of themselves? If the class is a member of itself, then it is not. But if it is not, then it is, the class is a member of itself if and only if it is not a member of itself. This paradox puts the entire philosophical project at risk, Frege would respond to it by saying that the only possible foundation of mathematics has been shattered. Indeed, a sketch of Russell's theory of types, his eventual solution to the paradox, also makes an appearance in one of the books appendix's.
It is well known that Russell and Frege each came to his views independently, and indeed Russell had just read Frege by the time his book had been finished and so added another appendix discussing and commending Frege's work. Probably the first philosophical discussion of Frege's work in the English-speaking world.
All in all, this book is worth every penny, it is one of the masterpieces of XXth century philosophy by any standards. One professor of mine once remarked that if Russell had developed his famous theory of descriptions by the time he wrote TPM and had included it in the book, the already masterpiece would then be wholly perfect, I am inclined to agree.