The gut microbiota is known to play an important role in energy harvest and is likely to affect feed efficiency. In this study, we used 16S metabarcoding sequencing to analyse the caecal microbiota of laying hens from feed-efficient and non-efficient lines obtained by divergent selection for residual feed intake. The two lines were fed either a commercial wheat-soybean based diet (CTR) or a low-energy, high-fibre corn-sunflower diet (LE). The analysis revealed a significant line x diet interaction, highlighting distinct differences in microbial community composition between the two lines when hens were fed the CTR diet, and more muted differences when hens were fed the LE diet. Our results are consistent with the hypothesis that a richer and more diverse microbiota may play a role in enhancing feed efficiency, albeit in a diet-dependent manner. The taxonomic differences observed in the microbial composition seem to correlate with alterations in starch and fibre digestion as well as in the production of short-chain fatty acids. As a result, we hypothesise that efficient hens are able to optimise nutrient absorption through the activity of fibrolytic bacteria such as Alistipes or Anaerosporobacter, which, via their production of propionate, influence various aspects of host metabolism.