Two characters, strangers or hostile to each other, accidentally discover a common thing. It can be an interest, a past experience or a background, but it foments friendship between them. For dramatic purposes, this is often between extremely different characters.
It can also mark the deepening of an existing relationship.
Lies can sometimes backfire when another character thinks it's this trope; see I Am One of Those, Too.
Compare Fire-Forged Friends; note that merely finding they were both soldiers or the like is this, though if they fought in some of the same battles, it may shade into that. For much more extensive commonalities, see Birds of a Feather. Also compare Lonely Together.
Contrast "Not So Different" Remark and Opposites Attract. Supertrope of Bonding over Missing Parents and A Shared Suffering. The lack of this drives Joins to Fit In. Examples that do not precede a friendship may go under The One Thing I Don't Hate About You.