A common misconception about research is that it is a single, isolated step in writing a paper.
Actually, research is a cyclic process that occurs the entire time you're writing a paper. It can even result in dramatic changes of direction for the work and in the development of a different thesis.