Understanding the response of ecological networks to perturbations and disruptive events is needed to anticipate the biodiversity loss and extinction cascades. Here, we study how network plasticity reshapes the topology of mutualistic networks in response to species loss. We analyze more than one hundred empirical mutualistic networks and considered random and targeted removal as mechanisms of species extinction. Network plasticity is modeled as either random rewiring, as the most parsimonious approach, or resource affinity-driven rewiring, as a proxy for encoding the phylogenetic similarity and functional redundancy among species. This redundancy should be positively correlated with the robustness of an ecosystem, as functions can be taken by other species once one of them is extinct. We show that effective modularity, i.e. the ability of an ecosystem to adapt or restructure, increases with increasing numbers of extinctions, and with decreasing the replacement probability. Importantly, modularity is mostly affected by the extinction rather than by rewiring mechanisms. These changes in community structure are reflected in the robustness and stability due to their positive correlation with modularity. Resource affinity-driven rewiring offers an increase of modularity, robustness, and stability which could be an evolutionary favored mechanism to prevent a cascade of co-extinctions.