For mediaeval philosophers, following Aristotle, individual things or beings were composites of a propertyless substratum or substance in general in which accidents or properties inhere in virtue of a substantial form, or essence. The substance thereby supports the accidents and makes their existence possible. A horse exists, for example, when the substantial form of horseness is predicated of a particular lump of undifferentiated substratum. The presence of the substantial form determines what properties the horse has.
Locke's investigation doesn't begin with this metaphysical thesis, however. He's interested in how we come to form the idea of substance. Locke’s descriptive theory of our ideas of substances is as follows. Our ideas of substances are constructed out of combinations of our simple ideas, which are taken to represent distinct particular things. A substance is our idea of something that exists of itself (i.e., something that is not dependent on something else for its existence). To this basic concept of substance in general are added the ideas of different properties we have like dull whitish color, hardness, fusibility, etc to form the idea of lead (Essay, II.xii.6, 165-6; references to the Nidditch edition). The mind notices that certain sets of simple ideas produced by external objects and conveyed to the mind through the senses are presented together with regularity. The mind is not able to imagine that these simple ideas or qualities can subsist by themselves, so the inference is made to the supposition that there is “some substratum wherein they do subsist.” So the idea of substance is arrived at by reason as a construction of the mind, not by direct perception (Essay, II.xxiii.1, 295). After we have formed this obscure idea of substance in general, we then form our ideas of particular sorts of substances, which are composed of the simple ideas which we realize exist together, and which we suppose to flow from a particular hidden inner constitution. The ideas of particular substance are made up of the substance’s primary and secondary qualities.
But because the idea of substance in general is one that is the product of reason (it’s a supposition on our part) rather than an idea gained directly through sensation or reflection, there is very little we can say about it. This is where Locke’s ridicule of the notion comes in:
They who first ran into the Notion of Accidents, as a sort of real Beings, that needed something to inhere in, were forced to find out the word Substance, to support them. Had the poor Indian philosopher (who imagined that the Earth also wanted something to bear it up) but thought of this word Substance, he needed not to have been at the trouble to find an Elephant to support it, and a Tortoise to support his Elephant: The word Substance would have done it effectually.He views the concept of substance to be something that we’ve asserted as a placeholder that indicates our ignorance of how objects and properties are connected to each other, making it of little use to philosophy. There are too many different meanings or uses for the term “substance” (it’s used to indicate God, spirits, men, inanimate bodies) for it to be coherently applied to problems.
The notions of “real essence” and “real constitution” (or “hidden inner constitution” Locke isn’t always consistent in his use of terminology), I think, are key to resolving the tension in Locke on substance. Locke contrasts the real essence of a thing with its nominal essence, which is the set of primary and secondary qualities that we use to pick it out in nature, along with our confused notion of substance in general. So for gold, the nominal essence is the idea of substance, plus its yellowish color, its malleability, its solubility in aqua regia, etc. All of our cataloging of substances and types of substances is based on their nominal essences. The real essence of a thing is the unknown arrangement of physical parts from which the observable properties that make up its nominal essence flow. So the real essence is the set of characteristics (the arrangement of corpuscles, perhaps) in the object that produce the perceivable qualities that we use to construct the nominal essence. So whatever physical properties a piece of gold has that generate its perceptible properties is its real essence, which we assume will be shared by all instances of gold, but we can’t know this for sure.
The real (or hidden inner) constitution of an object is simply the arrangement of all its parts, whether those parts are considered part of the real essence or not. For example, the particular shape of a piece of gold is part of its real constitution, but not part of its real essence. Only individuals can have real constitutions. The key point here is that these notions provide an (at least theoretical) explanation of how individual arrangements of particles of matter that make up an object generate the primary and secondary qualities by which we classify them.
This explanation for the properties of things would thus be consistent with the corpuscular hypothesis, whereas the traditional substance/accident model would not, even if it winds up providing the same (low level) of practical explanatory value. Locke believes that if we had full knowledge of the inner constitutions of things we would be able to deduce its qualities without experiment. Because of our epistemic limits, the notions of real essence and real constitution don’t wind up being any more practically useful in natural science than the notions of substance and accident, but that is because of limitations in us, not because they are conceptually inadequate, as “substance” is. Unfortunately for us, we do not have “Microscopical Eyes” that might allow us to make use of the real essences of things.