Introduction

The relationship between biodiversity and ecosystem functioning (EF) is a classic topic in ecology that is increasingly incorporating the role of belowground biota [1,2,3]. Soil microbial communities are extraordinarily abundant and diverse components of terrestrial habitats that control essential EFs [4, 5], understood as the properties of ecosystems including both the pools of materials (e.g., stocks of carbon or nutrients) and the rates of processes (e.g., organic matter decomposition, chemical degradation or gas exchange with the atmosphere) [6]. Microbial regulation of EFs depends on a myriad of taxa that share intricate interactions among them and with their environment [1], and whose individual contribution to the overall function is most likely the result of complex combinations of functional traits ([7]; Fig. 1a).

Fig. 1
figure 1

a Bacterial taxa’s individual contributions to a specific ecosystem function (EF) depends on a combination of functional traits that are conserved at varying depths across the phylogeny. EFs include both pools of materials and rates of processes. As an illustration, soil microbial productivity may depend on: T1: Oxidative respiration; T2: Growth efficiency in response to C substrates; T3: Use of glucose; T4: Use of lactose; T5: Use of glucuronamide [9, 20]. Exploring the community composition in terms of anciently or recently divergent lineages may enhance EF predictions. In the example, three ancient lineages mainly differ in their ability to respire aerobically or anaerobically (T1) and in their growth efficiency (T2), whereas eight recent lineages further distinctly use single C sources (T3–T5). For each taxon, EF is the sum of all trait values (i.e., non-blank cells). Numbers in the phylogenetic tree indicate branch lengths, in Million years. b Microbial communities with high EF levels can be assembled through niche or fitness differences, which respectively lead to high or low phylogenetic diversity (PD), and generating positive or negative PD–EF relationships. The phylogenetic depth of trait conservatism may also determine the magnitude of the PD–EF relationship. Left upper panel: The ability to consume glucose either using aerobic or anaerobic respiration may allow the coexistence of distant lineages, increasing PD and also EF due to the high functional complementarity of community members. Left lower panel: The ability to use distinct specific C substrates (e.g., lactose and glucuronamide) may allow the coexistence of closely related aerobic heterotrophs. Right panel: The best competitors in terms of growth efficiency in response to carbon sources overgrow and outcompete distant relatives, decreasing PD while increasing EF. The level of trait conservatism, e.g. use of glucose (upper panel) vs. glucuronamide (lower panel) will determine the strength of the negative PD–EF relationship. For each community, PD is the standardized mean phylogenetic distance and EF is the sum of all taxa values

The concept of biodiversity has rapidly expanded beyond the number of species to include the variety of life at every hierarchical level, from genes to ecosystems [8]. Phylogenetic trees capture the hierarchical architecture of nature by clustering together those lineages with similar genotypes and, when traits are evolutionarily conserved, similar phenotypes and even ecological niches [9, 10]. Thus, the phylogenetic proximity between two lineages may satisfactorily describe their functional proximity. This is the main reason why phylogenetic diversity (PD) has become a powerful predictor of EF [11,12,13,14,15]. However, other authors have shown circumstances under which PD poorly predicts EFs [16,17,18]. The most obvious instance is when the relevant trait for EF is randomly dispersed across the phylogeny, and therefore phylogenetic distances are not accurate predictors of either ecological differences or functions [19]. Despite this possibility, significant evolutionary trait conservatism seems to prevail across the tree of life, that is, close relatives tend to have more similar trait values than distantly related organisms, as has been shown both for eukaryotes [10] and prokaryotes [9, 20]. From the observation that traits impacting EFs tend to be phylogenetically conserved springs the key idea that the historical conditions under which lineages evolved might have long lasting effects (evolutionary legacy effects) that may have direct influence on the performance of ecosystems [21].

To better understand how the evolutionary legacy of the different lineages shapes EFs, several methods propose to look at the relationship between PD and EF (PD–EF) across the evolutionary time depicted in the phylogenetic tree [22,23,24,25]. Ecological communities are usually composed by a mixture of anciently and recently divergent lineages and such evolutionary disparity has been shown to be reflected in functional trait diversity [23, 26, 27]. Interestingly, the evolutionary conservatism of functional traits in bacteria occurs at different phylogenetic depths. Although genetically complex traits like oxygenic photosynthesis and methane oxidation are conserved very deeply in the phylogeny, other traits like the ability to use simple carbon substrates show evolutionary conservatism at very shallow clade depths [20, 28]. Thus, the coexistence of lineages whose ancestors diversified very anciently is expected to impact the EF in a different way than recently divergent lineages owing to their evolutionary legacies [21, 25], as exemplified in Fig. 1. Differences in the evolutionary depths represented in the ecological communities can determine the sign of the PD–EF relationship, as follows.

Communities with high levels of EFs may result from the coexistence of functionally distinct lineages (niche differences) and/or from the presence of one or a few productive lineages that outcompete the rest (fitness differences) [15, 29]. Functional differences allow species to coexist through the segregation of their niches and, at the same time, to deliver different functions to the ecosystem. Thus, niche differences simultaneously increase both species diversity and EFs. Niche differences with an ancient origin, as for example the evolution of aerobic vs. anaerobic respiration (Fig. 1a), determine the occupancy of major niches [20]. Therefore, communities containing those functionally different lineages will have complementary functions (i.e., high EF values) performed by extremely distant lineages in the phylogenetic tree (i.e., high PD values) (left upper panel, Fig. 1b). On the other extreme, niche differences evolved recently, as for example the efficiency to grow on different carbon sources (Fig. 1a), will also lead to positive, but weaker PD–EF relationships because the phylogenetic distance between functionally distinct lineages will be necessarily smaller (left lower panel, Fig. 1b). Supporting this scenario, experimental evolution tests with bacteria show positive biodiversity–EF relationship in communities assembled with specialist lineages because of the enhanced niche complementarity [2]. That is, lineages may coexist by exploiting a narrower range of resources and, this situation can provide further functions to the ecosystem because more specialized lineages are expected to be more efficient on their own ground than generalists are (see [30] for a discussion of this effect called jack-of-all-trades is a master of none).

Communities composed by a few but very productive lineages may also show elevated levels of EFs. These productive lineages are very effective in the use of resources and tend to exclude other lineages. When such competitive superiority is phylogenetically conserved [31,32,33], the salient picture can be a negative PD–EF relationship owing to the low PD of the whole community (Fig. 1). Again, the strength of such relationship will depend on the evolutionary origin of the relevant trait. When the trait conferring fitness advantage is phylogenetically conserved at ancient times, a significant number of members of a single lineage may outcompete entire clades, leading to extremely negative PD–EF relationships (right upper panel, Fig. 1b). However, the relationship will be weaker if the trait is conserved at shallower clade depths (right lower panel, Fig. 1b). Evidence showing high EF levels at negative PD have been related to the high fitness of Proteobacteria under carbon-enriched conditions [14]. Numerous members of this ancient clade respond to high contents of soil organic carbon [34], performing very efficiently particular EFs while outcompeting multiple distantly related clades [35]. This process eventually leads to the overrepresentation of Proteobacteria and remarkably reduces the PD of the soil bacterial communities [36].

Ecosystems with large environmental and trait variability provide ideal scenarios to test the relationship between biodiversity and EF [37]. Biodiversity effects on EF in spatially heterogenous ecosystems may depend on both complementary effects at a local place and turnover in species composition and dominance across places at a broader scale [38]. Evidence in mono- vs multispecies plant experiments indicate that EF is simultaneously mediated by niche differences in plots with functionally diverse species and by fitness differences in plots with functionally similar species [39]. In patchy environments, like those shaped by ecological facilitation between plant species, the presence of stippled plant patches composed by a nurse plant and its facilitated species increases the heterogeneity of (organic and water) resources at the landscape level. We have previously shown that plant patchiness begets soil environmental and bacterial trait variability [40]. Although more bacterial ecological strategies coexist in the open spaces between plants, the milder conditions underneath plant patches increase the functional and phylogenetic similarities among coexisting bacteria by intensifying the competitive dominance of a single clade [40]. The high dominance of the productive Proteobacteria reduces the PD of the whole bacterial community resulting in high EF levels at very low PD [14]. Interestingly, however, the low levels of PD are accompanied with a richness increment [40]. Such an increment in bacterial richness is consistent with an effective niche partitioning occurring at shallow clade depths. Assuming niche conservatism, niche partitioning will promote coexistence, especially among distantly related species whose niches are less overlapped [25, 41]. In line with this mechanism, Goldfarb et al. [35] have suggested that specialization on C substrates, a trait conserved at shallow clade depths [20], may contribute to the PD of soil bacterial communities. A phylogenetic signature of this process would be a positive PD–EF relationship at shallow clade depths.

Based on these observations, we expect that in our model system fitness differences will mainly operate among ancient lineages, whereas niche differences will prevail at shallower phylogenetic scales. To test this hypothesis, we combine metrics of diversity that capture the phylogenetic composition of soil bacterial communities over the evolutionary time so as to better explain a set of microbially driven EFs. We detect phylogenetic-scale disparities in the soil microbial diversity–EF relationship, and discuss them in terms of the prevalence of anciently and recently divergent lineages.

Methods

Study site

The study site, which is located in Alacant (SE Spain; UTM 30 N 689062, 4238201), is described in detail elsewhere [42]. In this semi-arid Mediterranean region (240 mm mean annual rainfall, 20 °C mean annual temperature), we sampled gypsum soils covered with a patchy shrub steppe dominated by the gypsophyte legume Ononis tridentata L. that facilitates the establishment of other plant species [13]. In a total area of ca. 0.2 ha, we collected samples from two microsites: (1) plant patches, that is, an O. tridentata individual and the group of plants growing underneath its canopy, and (2) gaps, that is, the open space between multispecific plant patches, where individuals of gypsum-tolerant plant species grow scattered [13]. Out of a total 43 plant species recorded in the sampling area, 18 were detected growing both in the patches and gaps [13]. We collected 30 soil samples, 15 underneath plant patches and 15 in adjacent gaps. Each soil sample was a mixture of five surface soil samples (0–2 cm) that were randomly taken from the area of each patch or gap. Samples were transported to the laboratory on ice and sieved through a < 1 mm mesh. Further details are given in Goberna et al. [40].

Soil bacterial sequencing and phylogenetic reconstruction

Procedures used for soil DNA extraction, PCR amplification of a bacterial phylogenetic marker, targeted metagenomics, and subsequent sequence processing can be found in Goberna et al. [40]. Briefly, DNA extractions from 1 g soil were performed with the UltraCleanTM Soil DNA isolation kit (MO BIO Laboratories, Carlsbad, CA, USA). We PCR amplified the 16S ribosomal RNA (rRNA) gene, using the universal bacterial primers 8F [43] and 534R [44] including 454 sequencing adaptors and 8-bp barcodes. Purified tagged amplicons were quantified using the Quant-iTTM PicoGreen dsDNA Kit (Invitrogen) and pooled in equimolar amounts. Two samples that failed to amplify were discarded. Pyrosequencing was performed with the Roche 454 GS-FLX system using Titanium chemistry. After demultiplexing, trimming of sequencing adaptors and primers, we removed short and low-quality sequences and chimeras. We defined operational taxonomic units (OTUs) at a maximum identity level of 97% and obtained 3290 OTUs using the complete-linkage clustering method [45] that were aligned using the Infernal aligner [46] after discarding singletons. Sequences representative of each OTU were assigned to bacterial taxa using the Naïve Bayesian Classifier [47]. The relative abundance of each OTU in each plot was calculated based on the total number of reads in the same plot, and subsequently corrected by the estimated number of 16S rRNA gene copies [48]. Sequences were deposited in the European Nucleotide Archive (https://www.ebi.ac.uk/ena/data/view/PRJEB4887; [40]). In all soil bacterial communities, we detected the same 12 bacterial phyla, excluding those representing < 0.2% of the total community. Proteobacteria and Actinobacteria were the most abundant phyla both in patches and gaps, accounting for 60–80% of the community. Most phyla were equally abundant in both environments but Proteobacteria that were overrepresented underneath plant patches and Acidobacteria, Gemmatimonadetes, Cyanobacteria and Firmicutes in the open spaces [40].

We reconstructed the phylogenetic relationships among soil bacteria using RAxML 7.3.0 [49] with the GTRGAMMA substitution model after screening out hypervariable regions according to the Lane mask [50]. We constrained tree topology to match the phylum-level relationships of the mega-tree built from the Silva database [51], so as to reduce the large phylogenetic uncertainty resulting from the usage of short pyrosequencing reads. We selected a phylogenetic tree among the best of 1000 iterations, and used Archaeoglobus profundus the outgroup. We calibrated the phylogenetic tree so that branch lengths represent evolutionary time (in Myr) by using eight dated nodes (Supplementary Information S1) according to Sheridan et al. [52] and Marin et al. [53]. Calibration was run with the treePL software using the thorough and prime options [54]. This algorithm uses a penalized likelihood approach to estimate the divergence times and allows for different rates in different branches. The method optimizes the smoothing parameter that determines how much the rate differences among the tree are penalized based on cross-validations. We run calibrations with smoothing parameters ranging from 0.1 to 1000 and found 10 to be the optimum smoothing value [54].

Microbial EFs

We measured six parameters as indicators of microbially driven EFs, including:

(i) Pools of soil (1) microbial biomass C (MBC), which we used as a surrogate of total microbial biomass, and measured using the fumigation extraction procedure [55]; and (2) ATP, as an indicator of the total microbial activity, which we extracted with the procedure by Webster et al. [56] and quantified with the luciferine–luciferase assay using luminometry [57].

(ii) Rates of processes, including soil: (1) Organic matter decomposition, which we measured as the microbial basal respiration (BR) during 28-day aerobic incubation assays of root-free soils to quantify the mineralization of organic C into CO2 through gas chromatography [58]; (2) C cycling, which we inferred from β-glucosidase activity, by quantifying the enzymatic hydrolysis of β-glucoside bonds of carbohydrates. β-Glucosidases often catalyze the rate-limiting step in cellulose degradation and have been suggested as key regulators of the whole cellulolytic process [59]; (3) P cycling, which we estimated from alkaline phosphatase activity by measuring the enzymatic break down of phosphoric esters into phosphoric acid and alcohols [60]. This reaction is directly responsible for the replenishment of the soil pool of inorganic P; (4) N cycling, which we measured as the urease activity that is responsible for the enzymatic cleavage of urea into ammonia and CO2. All rates of enzymatic hydrolysis were measured colorimetrically, based on the production of p-nitrophenol for β-glucosidase and phosphatase [61, 62] and NH4+ for urease [63]. Details on all protocols can be found in Navarro-Cano et al. [13] and data in Supplementary Information S2.

PD and EFs at different phylogenetic depths

We tested the relationship between the bacterial PD and EFs across the evolutionary time using the three approaches that follow, and analyzing altogether our 28 plots encompassing a large variability in environmental and EF parameters.

We first applied two simple metrics traditionally used in community phylogenetics that recover the outcome of the interactions at different phylogenetic levels: (a) standardized mean phylogenetic distance (MPD), which recovers all the interactions between the taxa in the phylogeny, and therefore across all the phylogenetic depths of the tree and (b) standardized mean nearest taxon distance (MNTD) that only reflects interactions between pairs of closely related species, and therefore at the shallowest phylogenetic depth [64, 65]. MPD and MNTD were computed using the picante package for R [66] as follows: MPD = (MPDobs – MPDrand)/sdMPDrand, where MPDobs is the average of all pairwise phylogenetic distances between the taxa in the local community weighed by their abundances, MPDrand is the average of MPD calculated in n randomly constructed communities (i.e., after randomly shuffling all taxa labels) considering the regional pool of taxa (i.e., the sum of all taxa identified in all plots), and sdMPDrand is the standard deviation of MPDrand ([67]; Supplementary Information S3). MNTD was obtained as MPD but pairwise phylogenetic distances were calculated between the nearest taxa [67]. A factorial linear model was applied to test whether MPD and MNTD significantly explained each EF. To verify that the PD–EF relationship is mediated by high levels of environmental heterogeneity, we added in further statistical models the factor Microsite (i.e., Patch vs. Gap) that is the main source of environmental variation in our system. EF parameters were log transformed for all analyses to normalize the residuals of the model.

After inspecting whether EFs were explained with the metrics accounting for different phylogenetic depths, we tested whether these EFs correlated with the diversification metrics identifying anciently (ES1) and recently (ES2) divergent lineages in each plot (Supplementary Information S4). We used the ELDERness (Evolutionary Legacy of DivERsity) approach that compares the polynomial function representing the observed accumulation of lineages across the time depicted in the phylogeny against a straight line describing lineage accumulation under a constant diversification model [25]. The intersection point between the polynomial function and the straight line separates two areas. The first area (ES1), from time 0 to the time where intersection occurs, represents the accumulation of ancient lineages. The second area (ES2), from the intersection to the present time, indicates the accumulation of recent lineages. Real communities often show complex patterns of diversification by accumulating (i) both ancient and recent lineages, or (ii) lineages accumulating at intermediate evolutionary ages (see [25] for a detailed explanation of the ELDERness surfaces). The analyses were run with the ELDERness code for R [25]. A factorial linear model was applied to test whether absolute values of ES1 and ES2 significantly explained each EF. A second set of statistical models included the factor Microsite as above.

Finally, to detect the particular phylogenetic depths at which EFs were significantly correlated with taxa composition, we used the Beta-Diversity Through Time (BDTT) approach (Supplementary Information S5). This approach allows testing whether plots differing in their taxa composition also differ in their levels of particular EFs across several temporal slices in the phylogeny of bacteria [23]. We established 40 temporal slices of 100 million years each, from 0 to 4000 Myr, and calculated the compositional turnover (i.e., beta-diversity) between communities at each time. We subsequently correlated the beta-diversity matrix with the distance matrix of each of the six EFs measured. The Bray–Curtis index, which accounts for abundance data, was used to calculate beta-diversity and Euclidean distance to calculate EF distances. Matrix correlation was performed through Mantel tests and statistical significance computed after 1000 permutations of taxa names in the phylogeny. Analyses were run with the help of the BDTT code for R [23]. All analyses were performed using R 3.4.2 [68].

Results

The traditional metrics that captures the PD across all the phylogenetic depths of the tree (MPD) indicates a negative correlation between PD and EFs. That is, plots with low PD tend to have higher levels of microbial biomass, activity, organic matter decomposition and cycling of organic C, N and P compounds (MPD in Table 1). The other metrics, reflecting the PD at the shallowest clade depths (MNTD) failed to explain most EFs considered in this study (MNTD in Table 1). Only for N cycling, did MNTD show positive significant effects (Table 1).

Table 1 Linear regression models testing the relationship between microbial (log transformed) ecosystem functions and the standardized mean phylogenetic distance (MPD), and standardized mean nearest taxon index (MNTD)

To explore the PD–EF relationship based on ancient and recently divergent lineages, we calculated the ELDERness surfaces. In all soil bacterial communities, we detected a complex pattern of diversification, with positive ES1 (mean = 81.4 range = [0.3, 368.9]) and negative ES2 values (mean = −2342.4, range = [−3081, −582.6]). This is the result of high rates of lineage accumulation both at the beginning and end of the evolutionary time spanned by the bacterial phylogenetic tree separated by a plateau with low levels of lineage accumulation (see an example of a lineage accumulation plot in Fig. 2). This branching pattern was common to all our study plots, but soils in open spaces tended to accumulate more anciently divergent lineages than soils underneath plant patches as shown by the larger ES1 values in gaps (t13.2 = 3.47, p < 0.05; Fig. 3a). On the contrary, gaps showed a significantly lower accumulation of recent lineages with their smaller ES2 values (t17.1 = 4.925, p < 0.05; Fig. 3b).

Fig. 2
figure 2

Accumulation of lineages in a study plot along the evolutionary time of the bacterial phylogeny. Each point reflects the divergence time of a given node in the phylogeny (x axis) vs. the number of lineages subtending that node (y axis). The solid line represents the expected accumulation of lineages under a constant speciation model. ES1 and ES2, respectively, represent the areas between the curve of accumulation of anciently and recently divergent lineages and the constant speciation line

Fig. 3
figure 3

Abundance of a anciently divergent (ES1) and b recently divergent lineages (ES2) in plant patches and gaps

EFs were significantly explained by the interaction between the abundance of anciently (ES1) and recently divergent lineages (ES2) (see significant ES1 × ES2 interaction in Table 2). The analysis of the statistical interaction showed that higher levels of all EFs were systematically detected in plots with high accumulation of recent lineages (Supplementary Information S6). However, such an increase was modulated by the accumulation of ancient lineages in a distinct manner for the EFs studied. The largest levels of microbial biomass and activity, as well as the fastest rates of decomposition and P cycling were found in plots enriched in recent lineages and having a low accumulation of ancient lineages. The highest rates of C cycling were achieved at high levels of recent lineages irrespective of ancient lineages, whereas N cycling increased in plots combining high accumulation of both recent and ancient lineages (Supplementary Information S6).

Table 2 Linear regression models testing the relationship between microbial (log transformed) ecosystem functions and the abundance of anciently diverged (ES1) and recently diverged lineages (ES2)

We verified that the environmental heterogeneity underlies the strength of the PD–EF relationship by incorporating to our statistical models the effect of the Microsite (patch vs. gap). This factor was highly significant in all models and overrode the power of simple metrics, such as MPD and MNTD, to predict EF levels (Supplementary Information S7). However, ES1 and/or ES2 were significant (or marginally significant) EF predictors even after accounting for the effect of the microsite for microbial activity, decomposition and C cycling.

To detect the particular phylogenetic depths at which EFs were significantly correlated with taxa composition, we calculated the β-diversity at different time slices across the phylogenetic tree. Significant correlations between β-diversity and EF distances indicate that communities harbouring similar bacterial lineages tend to display similar levels of EFs at all the phylogenetic depths between 0 and 2900 Myr (Fig. 4a and Supplementary Information S8). The highest correlations between EF and lineage composition were obtained for communities sharing either anciently divergent (2100–2900 Myr) or recently divergent lineages (i.e., 200–600 Myr), whose phylogenetic composition varied remarkably (Fig. 4b). The anciently divergent lineages at the phylogenetic depth of 2500 Myr corresponded to eight extant phyla and the most recent common ancestors of the clades Chloroflexi-OD1-TM7 and Planctomycetes–Verrucomicrobia–Gemmatimonadetes–Acidobacteria–Nitrospira (Fig. 4b). At 600 Myr, the total 16 bacterial phyla present in our study system were represented and had experienced a remarkable diversification (Fig. 4b).

Fig. 4
figure 4

a Phylogenetic-scale disparities in the relationship between soil bacterial diversity and ecosystem functions (correlation between β-diversity and decomposition distance) at different temporal slices. Significant and nonsignificant correlations are indicated with orange and grey circles, respectively. The time points at which the highest correlations are obtained are shown with horizontal dashed lines and projected to the phylogenetic tree. b Bacterial phylogenetic tree depicting the evolutionary relationships between 16 phyla present in the study system. At 2500 Myr, coloured circles indicate eight extant phyla and the most recent common ancestors of the clades Chloroflexi-OD1-TM7 and Planctomycetes–Verrucomicrobia–Gemmatimonadetes–Acidobacteria–Nitrospira

Discussion

Soil is an exceptionally heterogeneous habitat where a huge number of bacteria compete with their neighbours for space and resources [69]. Survival of bacteria in hyperdiverse communities raises the same problem posed by the “paradox of the plankton”. As Hutchinson [70] early noted, the coexistence of a huge number of competing species is possible under spatio-temporal heterogeneity of resources and conditions, positive interactions or differential predation. Ultimately, all these factors will determine species coexistence by altering the balance between forces equalizing niche differences and forces reducing fitness differences [71]. Each type of force leaves a different phylogenetic signature in the community structure [72] that we have used to explain the relationship between the PD and key EFs performed by soil bacteria.

The rationale behind the use of the PD as a proxy for EF initially stemmed from the simple idea that distantly related species have had more time to diverge functionally and, therefore, to provide a wider variety of EFs [11, 12, 15]. In this study, we found that this relationship is much more complex and requires the correct understanding of the outcome of ecological interactions occurring at different phylogenetic depths. The evolutionary legacy represented in soil bacterial communities leaves signatures of functional differences across the phylogenetic tree that can be used in an integrative way to understand the mechanisms behind EFs. More specifically, we detected that important EFs related to microbial productivity, decomposition and nutrient cycling required the use of metrics sensitive to both processes occurring anciently and recently in the history of bacterial evolution.

MPD, a traditional metrics that is sensitive to all the phylogenetic depths [73], indicates that bacterial PD is negatively correlated with the levels of all our estimated EFs. Supporting this interpretation, we also found, by using a beta-diversity through time approach, that communities resembling in their bacterial composition display similar levels of EFs across all the phylogenetic depths throughout 2900 Myr. This pattern held across EF, which were positively correlated (Pearson r > 0.7, p < 0.05). The negative PD–EF relationship detected with MPD could be broadly interpreted as fitness differences between productive and unproductive clades reducing PD and increasing ecosystem productivity [14, 74]. Although MPD cannot discern at which phylogenetic depths these processes are occurring, the maximum correlations between beta-diversity and EF were detected at ancient (2100–2900 Myr) and recent (200–600 Myr) times, suggesting a temporal dimension in the PD–EF relationship. We tried to focus at shallow phylogenetic depths by using the MNTD, which exclusively attends to phylogenetic distances between pairs of closest relatives. MNTD was, however, not able to detect PD–EF relationships for most EFs. This result probably reflects the fact that working at the tips of the phylogeny introduces a lot of uncertainty derived from the low phylogenetic resolution we currently have at the OTU level. Only for N cycling, did we detect a positive correlation between MNTD and EF, which could be theoretically assigned to niche differences occurring at shallow phylogenetic depths. Simple PD metrics such as MPD and MNTD have been shown to be worse predictors of EFs than more complex metrics that capture the patterns of diversification along the whole phylogeny [25]. This is particularly the case under complex branching scenarios, such as those occurring in our soil bacterial communities. By analyzing the branching patterns depicted in the phylogenetic tree through time, we could delimit how ancient (ES1) and recent lineages (ES2) contributed to each EF as follows.

We detected a general pattern indicating that the levels of all the EFs increased with the accumulation of recently divergent lineages in the community. The contribution of recent lineages to a positive PD–EF relationship agrees with the scenario in which niche differences mediated by traits conserved at shallow phylogenetic depths allow the coexistence of species (left lower panel, Fig. 1b). This process is coherent with the response of bacterial lineages to different organic sources that is phylogenetically conserved at shallow phylogenetic depths [20, 33]. Such differences in resource consumption arise not only from the various chemical structure of the array of organic substrates present in soil (e.g., organic P compounds) but also from the differential catalytic efficiency of enzymes that belong to the same family (e.g., phosphatases) depending on their biological origin [75]. The more effective niche filling with differentiated recent lineages would ultimately explain the correlation between high PD and EFs [25]. Such a consistent pattern was finely tuned by the accumulation of ancient lineages in the community, but in various ways for different EFs. Microbial productivity, in terms of biomass and activity, and the rates of decomposition were lowered in the presence of ancient lineages, what would be coherent with the scenario where fitness differences among deeply branching clades drive community assembly (right upper scenario, Fig. 1b). In particular, the presence of ancient lineages, like Proteobacteria and Actinobacteria, which are superior competitors that respond to experimental carbon inputs, may produce the competitive exclusion of less productive clades such as Acidobacteria, Planctomycetes or Verrucomicrobia [34, 35]. This process would simultaneously explain low PD and high productivity [14]. Similar responses of main bacterial phyla as those described after carbon addition to soil have been described following the amendment with other nutrients [76, 77]. However, we detected that EFs associated with the hydrolysis of organic C, N or P compounds showed idiosyncratic patterns regarding the contribution of ancient lineages. Further research on the complexity and evolutionary conservatism of the traits involved in bacterial rates of nutrient cycling is needed to assign these patterns to fitness or niche differences at the deep phylogenetic level.

Altogether, our results indicate that EF can be both increased or decreased with PD depending on the phylogenetic scale we attend. At first glance, these processes seem mutually exclusive but this situation has been already predicted by theoretical models. Indeed, theory predicts that even when EFs are explained by a few productive, competitive lineages, many other species are needed to keep high levels of EF if competitive hierarchy changes with time or space [38]. According to this prediction, the high spatial heterogeneity of resources and conditions in our study system mediates the PD–EF relationship by allowing different taxonomic groups to succeed. For example, some classes within the phylum Proteobacteria (Gammaproteobacteria and Betaproteobacteria) or families within Actinobacteria (Micrococcaceae) have been shown to outgrow and reduce the amount of available resources for their competitors [33, 35]. At the community level, the phyla Proteobacteria and Actinobacteria would be the dominant lineages outcompeting the rest of clades in the community. However, the competitive superiority of these clades would not reduce the species richness in the community because spatial variability in the available resources would change the competitive hierarchy within the dominant phyla promoting coexistence and, ultimately, richness [78].

Both fitness differences leading to competitive superiority at deep and niche differences at recent phylogenetic depths are shaped by evolution, making more complex the relationship between phylogeny and coexistence, and therefore the PD–EF relationship [79]. We admit that our interpretation of the mechanisms underlying the patterns observed remains speculative and assumes niche conservatism [25]. Assembling experimental communities with anciently and recently divergent lineages where both the outcome of competitive interactions and the levels of EFs were registered would help supporting or refuting the putative mechanisms we have described. Elusive relationships require complex models and therefore the inclusion of several phylogenetic metrics uncovering ancient and recent evolutionary histories will help improving our predictions on how the evolutionary legacy of soil bacterial communities explain EFs.