A phage infects a "donor" bacterium.
In its lytic cycle, the phage accidentally packages some "donor" DNA (e.g. A+ allele) in its protein coat.
When progeny phage then infect a "recipient" cell, DNA from the "recipient" may exchange with that of the "donor".
The "recipient" becomes a recombinant (A+ B-).