I think that there are a number of reasons for a medical student to do research, and all of them can help with residency applications, but it is important that there be an alignment between the research that was done and the overall narrative. You could engage in research as a clarifying experience; in other words, because you take your career and future seriously, you will engage in research as a medical student to determine whether it interests you, and whether its something you would like to pursue. Whatever you decide, showing that you have taken this step to learn something about yourself speaks to your seriousness and is a major positive. You could also engage in research to demonstrate commitment and interest to a specific clinical area, even if you don't intend to be a career researcher. Say you are interested in bipolar mood disorder from a clinical perspective; by participating in some research you will show that you have engaged with the extant literature in a robust way, and familiarized yourself with the process of increasing knowledge in this area, which will put you far above anyone who declares in interest simply because they have seen patients with that diagnosis and found them interesting. Research may also be a way to develop generic skills which are empirically demonstrated to enhance clinical performance - clinicians who have done research are better better clinicians on certain metrics, perhaps related to having an improved ability to make evidence-based decisions. Finally, for some, engaging in research as a medical student is a stepping stone to a scholarly career, and given the immense challenges associated with this career path, and the huge expense involved with supporting the development of a researcher during residency, having early publications that are relevant to the longer term research goals is essential.