Locke defines knowledge as the perception of the agreement or disagreement between ideas. To know that white is not black is to perceive the disagreement between those two ideas; to know that two plus two equals four is to perceive the agreement between those ideas. Knowledge in this strict sense is immediate — it is a direct perception of a relationship, not an inference from evidence. Where this direct perception is absent, we have not knowledge but belief, opinion, or judgment — which may be reasonable and well-founded but is not certain.
Locke distinguishes four types of agreement between ideas: identity or diversity (this is or is not the same as that), relation (how ideas stand to each other), co-existence or necessary connection (whether certain qualities always go together), and real existence (whether something corresponding to an idea actually exists). Knowledge of real existence is the hardest to achieve: we can know with certainty only our own existence (by the cogito-style argument), God's existence (by causal argument), and the existence of whatever we are currently sensing. Beyond that, we have probability rather than knowledge.
Locke's conclusion is not scepticism — he thinks genuine knowledge is available in mathematics, in ethics, and in some domains of natural philosophy. But it is a principled acceptance of limitation. About vast tracts of existence — the inner nature of physical substances, the mechanical workings of the body and brain, the operations of other minds — we have ideas but not knowledge. The right response is not to pretend to certainty we do not have but to proportion our assent to the evidence. Locke calls this rationality in the face of uncertainty: believe where the evidence warrants, suspend judgment where it does not, and never mistake confident opinion for certain knowledge.
This epistemological humility has a political counterpart: if knowledge is rare and opinion is ubiquitous, then no individual or institution can claim authority to impose its beliefs on others. The Essay's theory of knowledge supports Locke's later arguments for religious toleration: since none of us has knowledge of religious truth in the strict sense, no one has the right to coerce others' beliefs. The limits of knowledge are the foundation of the limits of legitimate authority.
Book IV of the Essay Concerning Human Understanding sets out Locke's formal theory of knowledge, degrees of assent, and the distinction between knowledge and probability. The connection between epistemological humility and political toleration is developed in Locke's Letter Concerning Toleration.
