Descartes’ View on Substance’s “Principal Attribute”

What does Descartes have in mind by a substance’s “principal attribute,” and in what sense do all of a substance’s other properties refer to this principle attribute?

In “The Principles of Philosophy”, Descartes argues that to each substance, there belongs “one principal attribute” and that this attribute constitutes its “nature and essence and to which all its other properties are referred” (p. 210). What Descartes has in mind by “substance” in general? How is the relation between a substance and its properties to be understood? Explain the two principal attributes that can define a substance (extension and thinking) and the key ways in which these principal attributes differ from one another.