Pensive first showed up in the late fourteenth century. It comes from the Old French pensif, thoughtful, which comes from the verb penser, to think. And as anyone who’s been paying attention knows, that word comes from classical Latin, the word pensare, which means weigh (metaphorically, like one would weigh a decision). Interestingly enough (I swear!), pensare is the frequentative (a verb that’s continuing in action) of pendere, which has varied meanings like to pay and to hang. Pendere also sprouted the line that would one day give English the word pendant.
That pay/hang definition makes some other words starting with pens- make a lot more sense. Pension showed up in the mid fourteenth century. It meant payment to a beneficiary back then, too, but also in general payment for services or a reward. It comes from the Old French pension, payment or rent, and the classical Latin pensionem, which is a payment in installations (you know, like a pension). Like the above pensare, pensionem also comes from pendere, making them linguistic cousins, I guess.
TL;DR: Pension and pensive are related because Latin had a single word for payment, weigh, and hanging, I’m guessing because payment was weighed out in hanging scales. History!