Look
here
uanews writes:
A more recently discovered and less well-known aspect of genome evolution in bacteria is gene loss, in which entire chunks of the genome are deleted. "A region of a hundred genes or ten genes may have been lost [at a time]... these big deletions occur all the time," Ochman states.
Whereas gene acquisition can be beneficial, gene loss is usually catastrophic. However, in host-inhabiting bacteria, the protection of the host environment may allow the bacteria to survive such a loss.
"If you're a free-living organism, you lose a certain gene, if it's essential, you're dead. But if it's something that's not essential," for example a gene for the production of a nutrient you can get from your host, bacteria can keep living and reproducing after the loss, but they can never perform that function again. Further, because they are imprisoned within the host, they may have little opportunity to gain the genes back from other bacteria by swapping genes.
Again: Google is your friend.
"Ignorance more frequently begets confidence than does knowledge: it is those who know little, not those who know much, who so positively assert that this or that problem will never be solved by science." - Charles Darwin.