The answer is the second one: “doing research things you see in the piece.”
When looking at text or art, one will always “bring to the table” prior knowledge with which he or she will analyze a work. And, strong claims are best made when the piece is understood within the context it was created. That said, it’s good to know as much as possible about the time period things were created in and to know as much as possible about the author because it will help one more fully understand the content. Most importantly, it helps to know about content within a work, so researching content that is foreign to you will help you in your ability in understanding the meanings of content that will shed light on the meanings and themes within a given work. So, yes, what will help you write a better analysis when you are looking at either text or art is doing research about things you see in a piece.