Habitat loss is a major driver of global biodiversity decline, and grassland ecosystems are critical for habitat conservation. In the Loess Plateau of China, prolonged agricultural practices and overgrazing have led to severe degradation of grasslands, causing biodiversity loss and reduced ecological functionality. This study examined the effects of connectivity and edge heterogeneity in three landscape mosaic types-farmland-grassland, river-grassland, and woodland-grassland-on biodiversity restoration. Using seven experimental units in the Ansai District, we assessed species richness, abundance, and community composition of butterflies, carabid beetles, and vascular plants. Our findings showed that connected habitats, particularly in farmland-grassland and river-grassland mosaics, on average increased species richness by over 38% compared to isolated habitats. Rare species were predominantly distributed in river-grassland mosaics, highlighting the importance of edge connectivity in supporting biodiversity. In contrast, biodiversity was lower in connected woodland-grassland mosaics, suggesting taxon-specific responses to connectivity. Vegetation played a key role in regulating biodiversity by providing food and shelter, emphasizing the need to conserve plant diversity for ecosystem recovery. Grazing intensity negatively affected vascular plants and carabid beetles, highlighting the importance of rational grazing management. Our findings highlight principles of connectivity and heterogeneity that are applicable to grassland restoration in arid and semi-arid ecosystems globally. Future research should explore how climate change and extreme weather events may moderate these effects. The results provide actionable recommendations for designing ecological corridors, optimizing landscape mosaics, and integrating sustainable grazing practices to restore degraded grasslands effectively.