Hume recognized that any account of free will has to be made compatible with our knowledge of the causal operations of the world around us. Given that his Treatise is an attempt to detail a "science of man" we should expect that Hume's explanation of human freedom to fit within his naturalistic and empiricist philosophy of nature. This is, in fact, exactly what we get. Hume puts his theory of the will within his general casual account and in doing so offers an interesting solution (or rather, dissolution) to the problem of the compatibility of free will and determinism.
According to Hume, necessity is universally recognized to be operative in all physical events. There are two components to Hume's account of necessity: the constant conjunction of two events (or rather the ideas in the mind representing two events) and the automatic inference of the mind from one to the other as cause to effect. Our interpretation of events as causally related to each other is thus purely the product of the mechanical association of ideas in the mind. Our understanding of human action is not an exception to this rule. If constant conjunction and association of ideas connect human action to our “motives, tempers, and circumstances” then necessity obtains in human affairs in the same way as the natural world (Treatise, II.iii.1, 399-401).
The first component to evaluate then would be the constant conjunction of motive and action. Hume observes that men everywhere are similar in many respects. Men everywhere form societies and these societies share similarities. Hume points out that nowhere in the real world would we find societies such as are described in Plato’s Republic or Hobbes’ Leviathan. Human action proceeds by general rules (II.iii.1, 401-3). Human behavior and society exhibit regularities that allow us to explain human action.
Hume anticipates an objection: isn’t human behavior actually unpredictable and capricious? Hume responds: just as in scientific experiments, where an unexpected outcome is explained by reference to other causes, the apparent unpredictability of human action is accounted for in the same way (T, II.iii.1, 403-4). In other words, we expect a person to act in a certain way and when she doesn't, we explain her behavior with an alternative series of causes rather than attributing it to randomness.
The fact that we reason causally regarding human action, mixing “natural” and “moral” causes together into the same explanatory narrative, shows that the other component of necessity is present as well, the inference from cause to effect. Understood in this way, it’s clear that everyone affirms necessity. Our epistemic practices show that we all are determinists, even if we don't know it. Hume goes so far as to claim that anyone who disagrees with him is really just changing the definitions of words (II.iii.1, 403-7).
So, why do we think we are free if we're not? Hume claims that there are a couple of main reasons for the insistence that we're free, despite the fact that our explanations of human action implicitly rely on causal reasoning. First, there is the phenomenal sense of freedom. Action feels as if it is done via volition, not out of necessity. But this betrays a confusion of the liberty of spontaneity with the liberty of indifference. The former is merely the absence of constraint, whereas the latter is the absence of cause. Liberty of spontaneity is the only notion of liberty worth preserving (II.iii.2, 407-8). Under the idea of the liberty of spontaneity, we are free insofar as we can act without being impeded by others. This is all the freedom we need, so it's all the freedom we should care about. Even if we have a sense of being unconstrained in our actions, it does not entail that such an unbridled liberty truly exists. No matter what we might try to do to act from no cause whatsoever, an impartial observer would rightly conclude that our action was an effect of some motive or disposition that we possess (II.iii.2, 408-9).
Second, it is claimed that the doctrine of the necessity of the will is one that damages religion (and we might add, moral responsibility). But this sort of argument is invalid as a class; it is arguing that the truth or falsity of a proposition is contingent on the desirability of its effects. But even setting aside this objection, Hume thinks there is good reason to reject this argument for liberty. Hume argues that viewing action as the effect of dispositional causes will yield a more effective morality since it can count of the efficacy of reward and punishment and allow us to place praise and blame on persons (or dispositions) rather than on temporary actions. Hume thinks that this accords better with our intuitive judgments about what sorts of actions to hold agents responsible for (II.iii.2, 409-12).
It is our more or less stable dispositions and propensities to have certain motivations and desires that lead us to act; Hume's term for those internal states that cause our actions is "passion" (by encompassing motivation in general, Hume's passions are broader than the exclusively emotional reference we might give this term today). It is a commonplace of philosophy that reason ought to overrrule our passions, and ought to select the best course of action for us if we're to be properly moral agents (II.iii.3, 413).
Hume wants to counter this received view with two conclusions for which he will argue: one, reason can never actually serve as a motive for action, and two, reason cannot oppose passion in the direction of the will. First, reason is not able to influence action, but instead directs our judgments on causal matters. The desire for pleasure or the avoidance of pain motivates us to take action. Reason simply elucidates which course of action will satisfy our desires. The impulse to act is derived from desire, not from reason. Hume's view of reasoning here appears to relegate it to intrumental, or means-ends reasoning. Reason cannot set our ends for us. It can only tell us how to get there.Second, if reason cannot motivate, then it stands to reason that it cannot contradict the impetus of the passions in moving the will, either. It is only a contrary impulse that could motivate a contrary action. Reason and passion are not in conflict; in fact, to quote Hume's famous phrase: “reason is and ought only to be the slave of the passions” (II.iii.3, 413-5).
Passions are not representational entities, and thus they carry no
truth-value. In this way, too, it is impossible for them to be contrary
to reason. It is only a passion that is accompanied by some judgment or
another that can contradict reason. Thus there are merely two ways in
which a passion can be unreasonable: (1) if it is founded on the
supposition of nonexistent objects (like if we have a desire to own a unicorn), or (2) if reason has chosen
insufficient means for attaining the desired outcome. Reason alone can
never force us to choose between two alternatives, no matter how
unbalanced they seem. “’Tis not contrary to reason to prefer the
destruction of the world to the scratching of my finger” (II.iii.3,
415-6). This may seem hyperbolic, but if we remember Hume's instrumental version of reasoning in regards human action, then we see his point.
Hume thus proposes an interesting solution to the free will problem. We don't have it, we don't need it, and we don't even give explanations for the behavior of ourselves and others that depends on it.