Locke defines liberty as the ability to act or refrain from action according to the will. The will, for Locke is our capacity to “order the consideration of any Idea” or the ability to “prefer the motion of any body to its rest.” The will is a faculty of the mind, not an independent agent, and we should take care not to mistake faculties for agents, or we'll fall into confusion. Only beings capable of thought or volition can rightly be said to possess liberty. Liberty is not possible for inanimate objects. A tennis ball, for example, is not taken by anyone to be an agent with volition; we do not attribute its motion or rest to its acting according to choice.
But volition is not sufficient for liberty; a man falling from a bridge, for instance, is not considered to be at liberty to stop falling simply because he wills to stop. A man who is unknowingly locked in a room but desires to stay is not truly at liberty to leave or stay, regardless of what he chooses or desires. So volition is not the same as liberty. "Voluntary" is to be contrasted with "involuntary" rather than with "necessary". Liberty is not total, either, even for a free agent. A man awake, for instance, is not at liberty not to think, but is at liberty to decide what thoughts to have, at least in normal circumstances (Essay, II.xxi.5-12, 236-40).
Locke holds that necessity governs all material processes: necessity occurs whenever thought is absent. Compulsion and restraint occur when an agent is prevented from undertaking an action or from continuing one. So liberty then is closely connected with the ability to do otherwise. Liberty consists in being able to act on the dictates of the will without some compulsion preventing the action. Locke thinks that framing questions of liberty in terms of the freedom of the will confuses matters. To ask if the will is free is to ask a nonsensical question like “is virtue square?” Liberty is attributed to agents, not to individual faculties. Volition or will is the power to prefer or not prefer to undertake an action; liberty is the ability to execute the preferences of the will without constraint or compulsion (Essay, II.xxi.13-15, 240-1).
Since the will is one power, and liberty another, asking if the will has liberty is asking if one power has another power. This question is nonsense, because substances and agents can have powers, but powers cannot. The will is known colloquially and in philosophy as a faculty; this obscures the fact that attributing freedom to the will is nonsense. But just as dancing does not act on singing, neither does choosing act on thinking. While it is possible for a man to choose as an act of volition what he thinks about, it is the man who is acting, not the will. It is the man who has the power, and this the man is the proper locus of the attribution of freedom. Locke contends that man is free insofar as he possesses the ability to act or not act in a given circumstance according to the preferences of his own will (Essay, II.xxi.16-21, 241-4).
So liberty is to be thought of in terms of the agent being able to execute the dictates of the will, but this still leaves the question of how the dictates of the will are determined. Locke does not think we are free to direct our will. When an action comes to a man’s mind as a possibility, the mind cannot help either preferring to take that action or to forego it. A man is not free to will or not will; our preferring is not a matter of choice. Locke goes even further than that, however. It is not only the case that an agent has no choice but to prefer; it is also the case that an agent has no control over what to prefer. The content of the preferences of an agent are as out of her control as the having of preferences (Essay, II.xxi.22-25, 244-7).
Ultimately, what moves the mind to engage its general power of directing either in staying in the same state or in acting to achieve a different state (i.e., what prompts the will to direct action) is some uneasiness. Uneasiness is thus the root of all action in Locke’s theory. Will and desire should not be confounded, since it is clear that one can will what one does not desire (Essay, II.xxi.29-30, 250) .
Despite the seeming obviousness of claims that the will is determined by
the greatest good, it is not the case. The good does not determine the
will until our desire for that good makes us uneasy in the want of the
good (Essay, II.xxi.35, 252-4). Desire is a specific form of uneasiness, one that is an uneasiness of the mind for want of some absent good. All bodily pain is an uneasiness, which is always joined to a desire (presumably a desire for the absent good which is the alleviation of the pain). The fact that Locke here indicates that desire is joined to uneasiness indicates that he does not regard the two terms as equivalent, although in extension they can be the same. However, not all absent goods provoke desire in us, since we may consider an absent good without desiring it (Essay, II.xxi.31, 250-1).
That desire is a state of uneasiness can be known by self-reflection. Life is an unbearable burden without the easing of our desires. Considerations of good and evil do have effect on the state of mind, but the immediate determiner of the will to every voluntary action is the uneasiness of desire fixed on some absent good, which can be negative (alleviation of evil) or positive (pleasure or enjoyment) (Essay, II.xxi.32-33, 251-2).
A man who is perfectly content in the state he’s in will simply continue in that state for as long as he can. Locke looks at uneasiness as a blessing from God—our uneasinesses which are caused by hunger and thirst (and other bodily functions) are spurs to action to eat and drink and procreate. Bare contemplation without the accompanying pleasure and uneasiness associated with the presence and absence of these good would not have been sufficient to make us act on them (Essay, II.xxi.34, 252).
The reason that it is uneasiness, rather than the good, that operates on the will is that the removal of uneasiness is the first step to happiness. While there is any uneasiness in us, we cannot consider ourselves to be happy. Since pain is the opposite of pleasure, and Locke seems to take pleasure and happiness to be closely related, the existence of pain will be a hindrance to happiness. The will can only be determined by one cause for an action, in order to avoid over-determination. Locke seems to be committed to a full causal theory of motivation, where the will is determined by operations according to causal laws (Essay, II.xxi.36, 254).
Locke indicates that there are instances of uneasiness which are so compelling that they will not let go of the will (vehement pain of the body, ungovernable passion of a man violently in love, impatient desire of revenge) and will not allow the understanding to lay those impulses aside, instead marshalling all the physical and cognitive resources of the person in pursuit of satisfying the uneasiness (Essay, II.xxi.38, 256-7).
The most pressing uneasiness naturally determines the will. Those uneasinesses which are the most pressing of those which are judged capable of being removed will take precedence over others. This introduces judgment into the desire-uneasiness-will nexus where it was not present before (Essay, II.xxi.40, 257-8). This is also as close as Locke comes to saying that there is a higher order
cognitive function that regulates the operation of the will's
determination of action, and so as close as he comes to affirming anything like our modern notion of free will. The role of judgement is the ordering of the dictates of the will to satisfy the most pressing first.
Locke does still allow for judgement to function in shaping the will in an indirect sense, however. We have the power, through “due consideration” of a particular good to raise our desire for that good to the level needed to provoke in us the uneasiness necessary to action. Without this, our wills are under the determination of the uneasiness most pressing upon us; the balancing that the mind can do being limited to determining which uneasiness should be addressed. While there is uneasiness in our minds, there is no room for good to come to the will (Essay, II.xxi.46, 262-3). The idea here seems to be that the consideration of some abstract or future good can begin to stir up the desire for that good to be achieved; once that desire takes hold, it produces an uneasiness in us. If the uneasiness becomes strong enough, then the will directs action to satisfy the desire for that particular good and not forego it in deference to another desire's satisfaction.
This route is complicated though, and hardly foolproof. An extreme disturbance (pain of the rack, impetuousness in love or anger) can come to occupy our whole mind and prevent our ability to consider thoroughly what the proper course of action is. Locke considers that we are excused from moral responsibility in these cases, since the will is overwhelmed by the uneasiness felt. We should, however, attempt to attune our desires to the true intrinsic good in things and not tolerate much hasty compliance with our desires, for many things which we claim not to have been able to forbear would, on further consideration been forborne in the presence of a “prince or great man” (Essay, II.xxi.53, 267-8).
No man will choose wrongly as regards his preferences. Locke claims that
wrong action is the result of misled judgments regarding the long term
consequences of actions. If we were given all the relevant information
associated with a decision, we would not fail to choose rightly. Our
psychological makeup being what it is, we are prone to choosing a lesser
present good to a greater absent one, and will be satisfied with a
present contentment. We then wait until some new uneasiness appears to
motivate us to action. This failure to appreciate the true value of
absent goods is made most clear when we contemplate the failure of some
people to properly act so as to obtain the greatest goods of Heaven and
such (Essay, II.xxi.58-60, 272-4).
There is still the problem of how we end up choosing wrongly, then, in cases where we know what the right thing to do is. In the end, Locke proposes an almost Socratic account of how a man chooses against his considered evaluation of what is good; Locke relates bad action to ignorance. A man might be fully capable of acting in accordance with his will, and thus have full liberty of action, but may not properly employ judgment in a given case. In failing to allow judgment to adjudicate in a case a man may act rashly and do something he thinks is appropriate at the time, but which he would not have done if he had suspended action in accordance with the will until judgment had its say (Essay, II.xxi.56, 270-1). So bad judgments are hasty judgments made to satisfy an immediate desire. If we allow the second order regulation of the will by considered judgments, our actions will be more reliably right.