Life on Earth was dominated by bacteria for billions of years1. About 600 million years ago, animal life emerged and micro-organisms played a crucial role in shaping animal development, physiology and evolution2-4. The two partners committed to a symbiotic relationship that persists in nearly all animals today. Such beneficial interactions are pervasive throughout nature and have been extensively characterized5,6. However, the ecological and evolutionary forces that drive the emergence and evolution of the symbiont benefits to their animal hosts remain largely elusive. Here we show that the host nutritional environment, instead of the host, is a predominant driving force in this evolutionary process and we identify a mechanism resulting from the bacterial adaptation to the diet, which confers improved functional benefit to the host. By applying experimental evolution to a model of host-bacteria beneficial symbiosis: Drosophila melanogaster associated with Lactobacillus plantarum, one of its growth promoting symbiotic bacteria7,8, we found that the de novo mutations in the same acetate kinase (ackA) locus invariably emerge first, rapidly become fixed, and such evolution occurs with or without the host. Furthermore, we demonstrate that ackA mutations trigger the increased production of N-acetyl-glutamine, which is sufficient to confer improved host growth capabilities to the evolved bacterial strains. Our study therefore identifies a specific mechanism by which a symbiotic bacterium increases its benefit to its animal host and reveals that adaptation to the host diet is a foremost step in the determination of the evolutionary course of symbiosis between an animal and its gut microbes.