A paired t-test incorporates the possibility that the two variables whose means are being compared may also be correlated. In the following example, participating back-pain patients receive actual medication for one stretch of, say, six weeks and placebo (sugar pills) for a different stretch of six weeks. Ideally, the patients and medical staff who directly provide the pills to the patients would not know what kind of pill was being provided (i.e., a double-blind design) and the order of delivery -- medication then placebo or placebo then medication -- would be varied at random.
The focus of the paired t-test is, of course, whether participants' average reported pain while taking actual medication differs from their average reported pain under placebo. However, because patients with the most severe initial pain might report relatively high pain under medication and even higher pain under placebo, whereas patients with the mildest initial pain might report relatively low pain under placebo and even lower pain while receiving medication, patients' pain reports under medication and placebo could be positively correlated (see following graphic).
As shown in the following screenshot from this University of Georgia webpage, the correlation r between the two variables X and Y (highlighted) enters the paired t-test formula for comparing means.
I've also created a graphic to interpret the SPSS output of a paired t-test, emphasizing the t-test comparison of means but also showing where the correlation between the two variables appears.