The answer is ‘by descent from a common ancestor’. Sequence homology (nucleotide or amino acid sequence similarity) is used to compare two segments of DNA for shared ancestry through either of the following three phenomena: either a speciation event (orthologs), or a duplication event (paralogs), or else a horizontal (or lateral) gene transfer event (xenologs).