R' Tzvi Hirsch Chayos in Mavo HaTalmud writes about various midrashic methodologies employed by Chazal in the Gemara and Midrash. In the twenty-first chapter, he discusses this tendency to identify a person mentioned in Tanach with someone else in Tanach, or to equate two names as belonging to the same person (e.g. "הוא מלאכי הוא עזרא").
Chayos treats this as a subcategory of the more general genre of attributing righteous actions to tzaddikim even with only slight prompts from the text and/or mitigating what seems to be their negative actions or qualities even when they are explicit (think, for example, of Chazal's treatment of David and Bathsheva). This works in the reverse as well; Chazal tend to attribute bad deeds to otherwise known resha-im and to downplay their "seemingly" redemptive qualities. He discusses examples of this and the reasons for these exegetical methods in the previous (twentieth) chapter.
Based on this, Chayos writes, Chazal often equated two people as the same individual for the purpose of bringing out their similar qualities or specific similarity. They may identify a certain personality as "identical" to another to emphasize the (good or bad) quality in the former that is apparent and known in the latter. This way, in the case of a righteous individual, they are heaping upon them praise by associating them with another righteous individual with additional great qualities. The same is true in the reverse (for the unrighteous).
Another approach is seemingly taken by more modern parshanim. (I can't seem to find a good source for it, but Josh Waxman over at ParshaBlog uses it from time to time.) That is the "closed canon" approach of the Midrash, as opposed to the "open canon" approach. The closed canon approach holds that everything necessary for the interpretation of Tanach is included somehow in the Tanach itself. There is nothing that cannot be understood without reference to external sources. What seems to follow from this is that if we are introduced to a figure in Tanach without background on who s/he is, we must be able to identify them as someone who is mentioned elsewhere whose background is given. The "open canon" approach, on the other hand, would hold that this is just a reference to someone who we do not otherwise have any information about.
The particulars of the above distinction seem ambiguous and may not be considered constant. What is considered enough information about a person for them to be considered "known" in Tanach, versus the references to "unknown" people that need to be identified? I'm not sure that rigid boundaries for something like this necessarily exist.