Lepidopteran insects are one of the most widespread and speciose lineages on Earth, with many common pests and beneficial insect species. The evolutionary success of their diversification depends on the essential functions of gut microorganisms. This diverse gut microbiota of lepidopteran insects provides benefits in nutrition and reproductive regulation and plays an important role in the defence against pathogens, enhancing host immune homeostasis. In addition, gut symbionts have shown promising applications in the development of novel tools for biological control, biodegradation of waste, and blocking the transmission of insect-borne diseases. Even though most microbial symbionts are unculturable, the rapidly expanding catalogue of microbial genomes and the application of modern genetic techniques offer a viable alternative for studying these microbes. Here, we discuss the gut structure and microbial diversity of lepidopteran insects, as well as advances in the understanding of symbiotic relationships and interactions between hosts and symbionts. Furthermore, we provide an overview of the function of the gut microbiota, including in host nutrition and metabolism, immune defence, and potential mechanisms of detoxification. Due to the relevance of lepidopteran pests in agricultural production, it can be expected that the research on the interactions between lepidopteran insects and their gut microbiota will be used for biological pest control and protection of beneficial insects in the future.