Ways in which it can happen:
Current Wikipedia seems to say that this refers specifically to cells taking up DNA from other dead cells as in the Avery-MacLeod-McCarty experiment, excluding other types of horizontal gene transfer like bacterial conjugation
Articles by others on the same topic
Horizontal gene transfer moves genetic material between lineages through routes other than ordinary inheritance from parent to offspring. Endosymbiotic gene transfer is a specialized case involving an internal partner or its descendant organelle.