Gratitude (Stanford Encyclopedia of Philosophy)

Though the content of grateful beliefs may vary, a beneficiary must form more than just the belief that something good has happened to him, if he is to qualify as grateful to R. If a benevolent stranger saves my life at great risk to herself, and I consequently form no beliefs about her as an agent (e.g., that she is a benevolent or brave person, or that she cares about me), then I fail to be grateful to her—though I may be grateful that she saved me if I form the belief that something good has happened to me.

The difference in the content of the beliefs called for in response to benefit from an agent, on the one hand, and benefit more generally, on the other, is yet another way in which prepositional gratitude is distinguished from propositional “gratitude”, or appreciation (see section 1).

https://plato.stanford.edu/entries/gratitude/