Any serious theory of pleasure has to explain why people like art, including paintings.
You and I agree that there are many factors at play here—a painting might depict something that is beautiful, it might be associated with a positive memory, it might raise one's social status, and so on. And then there is essentialism. Consistent with the broader theory defended in How Pleasure Works, I would argue, building from the work of the philosopher Denis Dutton, that our experience of an artwork is profoundly affected by our belief about what that artwork really is. It matters to us who created it and how it was created.
We agree on this, but you are not convinced that these considerations are sufficient. You tell the story of when you were blown away by a portrait in the Prado, and you ask, skeptically: Can my sort of theory can really capture the exhilaration you felt, this bolt from the blue?
I think it can. And I'm intrigued by your hesitation. Most interesting here is your claim that "surely the main aspect of my response was to the composition of the work"—it was "the object of art itself, its complex content" that blew you away. I am intrigued by how confident you are—the "surely." You are not alone in your confidence. People tend to believe that they are responding to the world as it really is. Isn't it obvious, after all, that we can admire a painting without being contaminated by context and history (in your case, that you're in the Prado, looking at a masterpiece by Diego Velázquez)? Surely what we perceive matters more than what we believe!
It sure seems that way, but this is an illusion, a powerful one that extends to art, to food and drink, and to sex and love. It is shown to be mistaken through the sort of studies we talked about earlier, where psychologists manipulate the information that people receive—this bottle of wine cost $300, this sweater was worn by a celebrity, this painting was completed in 10 minutes. This manipulation affects people's responses in predictable ways, even though—because they believe that pleasure is to be had in the things themselves—they are unaware that they were influenced, and would probably deny it if you told them. The depth of pleasure is largely invisible to us.
Let's look again at the Velázquez. You talk eloquently about how you were possessed by feelings such as fear and loneliness. But now imagine that as you walked into the room, you were momentarily confused, and thought for an instant that you were looking not at a portrait, but an actual man. Your reaction would have been entirely different. This is especially the case with your pain, and the pleasure you got from it. You say that sometimes "we simply like pain," because it confirms our sense of how the world is. But it is never that simple. Nobody would look at a starving child and enjoy the experience, getting a kick out of her authenticity, how her suffering so nicely illustrates the way that the world really is. Your own pleasure was critically dependent on your knowledge that you were regarding an artistic creation, not a real person.
More generally, just as with pleasure, our experience of pain reflects our beliefs about the experience—what it is and where it comes from. Kurt Gray and Daniel Wegner recently published a neat study which found that electrical shocks are more painful if you believe that they are given on purpose as opposed to by accident. And I tell the story in my book of a woman who was a quite heavy-duty masochist but who was afraid of getting her teeth cleaned—what the dentist had to offer wasn't the right sort of pain. I agree that not all cases of benign masochism involve make-believe, but one always needs the element of control. This added element may also help explain something else that you mention—the active and engaged nature of certain pleasures, particularly aesthetic ones.
Shakespeare might have been overstating things when he had Hamlet say: "there is nothing either good or bad, but thinking makes it so." But it is not far from the truth.
Thank you for doing this with me. This sort of experience—discussing ideas with someone who is sharp and critical yet also sympathetic and engaged—is one of the pleasures that I value the most.