A cell living inside another cell can slowly give up its genes
When one organism becomes a permanent part of another cell, some of its genes can move into the host's DNA. Once the host has a working copy, the original gene can disappear. Repeated many times, this slowly shifts genetic control from the inner organism to its host.