The salt solution and sugar solution is used for the process of food preservation as the bacteria and microorganism are not able to grow in such conditions that is being created by the solution.
The amount of the solute is more and the solution is less concentrated. The bacteria cell has less solutes and more solvent.
As per osmosis the water from the salt or sugar solution moves out from bacterial cell shrinks and dies.
This is how the bacterial cell dies and the food is prevented from spoilage.
Well if it could not adapt it would die. Either it would be killed by a more superior species, natural selection would take its course, or it just wouldn't be able to survive.