Chance and necessity in the assembly of plant communities: Stochasticity increases with size, isolation and diversity of temporary ponds

Biodiversity emerges from niche mechanisms, in which the combination of traits determines species performance, and populations drift because of the inherent stochasticity of community assembly processes. Population biology dictates that small and isolated communities are more prone to show stochastic assemblages. However, a reduced mass effect in isolated communities may promote trait selection. In addition, large and connected communities have a larger species pool, higher functional redundancy, lower population sizes and more random recruitment, which also fosters stochasticity in community assembly. These contradictory expectations demand empirical analyses. Plant metacommunities in temporary ponds are assembled by the action of strong environmental filters and cover wide ranges of local community sizes and connectivity, representing ideal systems for identifying determinants of trait‐selection processes. Using a deviance partition method introduced by the theory of community assembly by trait selection, we evaluated the role of plant traits in local community assemblies along 60 communities from a 14‐year plant survey of temporary ponds. Variation in pond size, hydroperiod, connectitivity and heterogeneity determined a selection gradien in traits related to drought resistance, life history and disperal strategies; and also in the strength of trait‐mediated community assembly. The taxonomic and functional diversity of a pond and its physical heterogeneity fostered stochasticity in the assembly of the community, which also presented a hump‐shaped association with connectivity. The pond area increased taxonomic richness but decreased functional diversity, determining negative and positive indirect effects on stochasticity. Synthesis. Diversity provides the raw material for trait selection putatively reducing stochasticity, but here diversity was positively related to stochasticity. Having enough functional diversity, larger redundancy and lower population sizes in diverse communities is probably fostering stochastic assemblages. The hump‐shaped association between stochasticity and connectivity supports a larger role of trait selection in isolated systems due to a weak mass effect, but also on connected communities in which a set of more optimal traits for the selection scenario could be available. In the ongoing state of ecosystem fragmentation, these empirical trends contribute to the mechanistic understanding of the connection between landscape structure and biodiversity assembly.


| INTRODUC TI ON
The relative importance of niche and neutral processes in community assembly has been extensively debated (Ai et al., 2013;Gravel et al., 2006;Holyoak & Loreau, 2006;Laroche et al., 2020;Leibold & McPeek, 2006;Leibold et al., 2019;Mitchell et al., 2019;Munoz & Huneman, 2016;Siqueira et al., 2020;Tilman, 2004). If species traits do not affect their performance, then the community is neutrally assembled, and stochastic trait-independent drift in the relative abundance of species is expected (Hubbell, 2001). The assembly of communities by niche mechanisms, in which species are selected in the assembly processes based on their traits, is a force in opposition to stochasticity, leading to a more deterministic species composition in communities (Shipley, 2010;Vellend, 2016). It should be noted that while traits bias the success of species in a community, this is also a random process in which stochasticity is still determining species abundances (Shipley, 2010;Vellend, 2016). However, the stronger the trait selection-niche assembly-the lower the stochastic drift in abundance will be (Shipley, 2010;Vellend, 2016).
Theoretical studies indicate that community size and isolation are the main determinants of the relative importance of trait selection and drift in community assembly. However, both positive and negative effects could be expected. Population genetics and population ecology hold that small and isolated communities are more prone to show drift in abundances and, consequently, more closely resemble neutral assembly patterns (Adler et al., 2007;Fukami, 2015;Gilbert & Levine, 2017;Orrock & Watling, 2010;Siqueira et al., 2020). In large and connected communities, the large number of individuals reduces the stochasticity of random processes (Fisher & Mehta, 2014;Orrock & Watling, 2010;Siqueira et al., 2020) and the increase in functional diversity may enhance the role of niche mechanisms (Enquist et al., 2015;Shipley, 2010). This is because trait selection requires functional diversity to play its role in community assembly. Without variation in traits, selection cannot affect species abundances (Shipley, 2010).
In contrast to previous arguments, other mechanisms can promote a larger role of traits in small and isolated communities and of stochasticity in large and central communities. Species richness increases with community size, and different mechanisms may be beyond a positive stochasticity-richness association, such as the increase in priority effect (Chase, 2010), functional redundancy (Shipley, 2010), lower average population sizes (Fukami, 2015), neutral aggregations (Scheffer & van Nes, 2006) and a larger species pool for recruitment that reinforces previous mechanisms. In fact, at least on a global scale, a positive association between drift and total richness has been reported in forest plots (Leibold & Chase, 2018).
Furthermore, if heterogeneity increases with area and/or the opposite occurs with disturbances, then attenuation of environmental filters reduces the strength of trait selection favouring stochasticity in community assembly (Cadotte & Tucker, 2017). On the other hand, dispersal limitation by isolation can enhance trait selection when only species with high dispersal abilities are able to reach isolated communities (Ai et al., 2013). A smaller number of incoming dispersers also reduces the role of mass effects, resulting in a closer connection between species traits and performance (Ai et al., 2013;Borthagaray, Pinelli, et al., 2015;Leibold et al., 2004Leibold et al., , 2019. In summary, the relative importance of the niche and neutral assembly of a community may systematically change along gradients of community size and isolation, with species richness and functional diversity playing core roles in these trends, but having contrasting theoretical expectations. In this context, presenting empirical analyses is the essential step for advancing theoretical constructions (Grainger et al., 2022;Marquet et al., 2014).
Empirical studies have indirectly considered the role of traits or drift in community assembly. Methods have included fitting to diversity distributions (Fisher & Mehta, 2014;Hubbell, 2001), partitioning of variance (Bosc et al., 2019;Brown et al., 2017;Gilbert & Lechowicz, 2004), multivariate ordination for visualizing traitenvironment associations (Legendre & Legendre, 1998) and contrasting with null models (Chase, 2010;Chase & Myers, 2011;Siqueira et al., 2020;Tucker et al., 2016). Recently, novel methods for the direct analysis of the role of traits in community assembly have been proposed Dray et al., 2014;Keddy & Laughlin, 2021;Peres-Neto et al., 2017;Shipley, 2010Shipley, , 2014. Among them, the methodology introduced in the theory of community assembly by trait selection (CATS) provides a direct evaluation of the in diverse communities is probably fostering stochastic assemblages. The humpshaped association between stochasticity and connectivity supports a larger role of trait selection in isolated systems due to a weak mass effect, but also on connected communities in which a set of more optimal traits for the selection scenario could be available. In the ongoing state of ecosystem fragmentation, these empirical trends contribute to the mechanistic understanding of the connection between landscape structure and biodiversity assembly.
biodiversity, community assembly, connectivity, drift, functional diversity, landscape, stochasticity, trait selection role of traits in species performance and of the role stochasticity in community assembly (Cunillera-Montcusí et al., 2020;Loranger et al., 2018;Shipley, 2010Shipley, , 2014Shipley et al., 2006Shipley et al., , 2012. Ephemeral environments impose a strong selection regimen for species survival in changing environmental conditions (Cunillera-Montcusí et al., 2020). Temporary ponds frequently conform metacommunities with large gradients in local community sizes, isolations, hydroperiod regimens, local heterogeneities (Richardson et al., 2022;Srivastava et al., 2004) and spatial gradients that were related to community structure in empirical studies (Arim et al., 2010(Arim et al., , 2011Cunillera-Montcusí et al., 2020;Rodriguez-Tricot & Arim, 2020). Therefore, the nature and strength of trait-mediated community assembly versus stochastic drift is expected to systematically change along these gradients (Cunillera-Montcusí et al., 2020). For these reasons, metacommunities of temporary ponds conform suitable models for the empirical analysis of metacommunity assembly mechanisms (Srivastava et al., 2004). Here, we focus on a 14-year survey in which the occurrences of 100 plant species in 60 temporary ponds were recorded.
These ponds cover a wide range of connectivity and local conditions, showing a large species turnover between ponds (Arim et al., 2011;Canavero et al., 2014;Piñeiro-Guerra et al., 2014;Rodriguez-Tricot & Arim, 2020). This pattern supports a putative role for trait-mediated species filtering and traitmediated dispersal effects on community assembly.
In the present study, we focus on this plant metacommunity to evaluate the hypothesized determinants of the relative importance of stochastic versus niche-based processes in community assembly. Explicitly, the following hypotheses were considered ( Figure 1): Hypothesis 1: the size of the community, the number of individuals from all species combined, increases the taxonomic and functional diversity of communities because it allows for a greater number of species with viable populations (Storch et al., 2018). As the size of the community is proportional to the area of the pond (Berazategui, 2012), the taxonomic and functional diversity should increase with this variable. Hypothesis 2: Functional diversity increases the strength of trait selection in community assembly because the differences in traits between species are the raw material for the action of selection on community assembly (Enquist et al., 2015;Shipley, 2010).
Hypothesis 3A: Taxonomic richness increases functional diversity that promotes trait selection. Hypothesis 3B: In opposition to 3A, taxonomic diversity can increase stochasticity in community assembly due to an increase in functional redundancy (Rosenfeld, 2002), priority effect (Fukami, 2015) and a reduction in the average population sizes (Storch et al., 2018). Hypothesis 4A: Dispersal limitation by spatial isolation of communities fosters stochasticity due to a reduction in taxonomic and functional diversity and an increase in the random variation in species recruitments (Chase, 2010;Fisher & Mehta, 2014;Fukami, 2015;Leibold & Chase, 2018;Orrock & Watling, 2010;Siqueira et al., 2020). Hypothesis 4B: In opposition to 4A, isolated communities select species with good-dispersal traits and reduce the strength of mass effect, enhancing the traitperformance association (Ai et al., 2013;Borthagaray, Pinelli, et al., 2015;Leibold et al., 2004Leibold et al., , 2019. Hypothesis 5: Heterogeneity and low frequency of disturbance relax environmental filters, at least in temporary ponds, reducing the strength of trait selection (Cadotte & Tucker, 2017).

| Study system
The metacommunity of plants evaluated in this study is located in a flat landscape surrounded by hills, where a maximum of 61 ponds, every year, are filled with water in winter and dry out in summer in the same spatial locations (Figure 2). The study area is located in the Castillos Lagoon basin, in the Rocha department, Uruguay (34°15′16.9″ S 53°58′51.6″ W; 5-8 m altitude). According to the Köppen-Geiger climate classification system, it belongs to the category of 'Cfa' climate, characterized by a humid subtropical climate with hot summers and mild to cool winters (Kottek et al., 2006). In the study area zone, during the study period (2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016)(2017)(2018), the mean annual temperature was 16.6°C (mean minimum monthly temperature of 11.3°C, mean maximum monthly temperature of 21.9°C), with extreme recorded temperatures of −9.0°C (exceptionally in spring) and 39.8°C in summer. The mean annual precipitation was about. 1287 mm, with an annual minimum and maximum of 1676 and 847 mm respectively; while the mean annual wind velocity was 9.2 km/h coming predominantly from the east, with gusts of approximately 44 km/h (Meteomanz, 2020).
Temporary pond soil textures range from clay to silt to loam, with a predominance of loam and clay loam soils. The land cover in the study area is classified, based on satellite imagery, as grasslands, flooded grasslands and agriculture or pasture (Baeza et al., 2022).
Temporary ponds are distributed along two rural establishments dedicated to extensive cattle raising and ecotourism.
Every spring since 2005, these ponds have been sampled equidistantly using 20 × 20 cm quadrants on the major axis. On average, five quadrants were sampled in most ponds. However, to account for the range of pond areas, which exhibits differences in several orders of magnitude (from 6.6 to 24,673 m 2 ) when the quadrants were closer than 2 m, the number of sampled units was reduced, and if the quadrants were more than 10 m apart, then the number of sampled units was increased (Arim et al., 2011;Piñeiro-Guerra et al., 2014;Rodriguez-Tricot & Arim, 2020). As a consequence, while five sample units were collected in most ponds, few or more quadrants were sampled in smaller and larger ponds respectively (range 2-22, see Figure S1). The depth does not follow a smooth increase from the border to the centre of the ponds. In fact, shallow and deeper areas alternate along the bottom, even forming small dry islands (see Figure 2). Differences in island density and spatial variation in depth within ponds represent one of the main sources of heterogeneity, which was related with the assembly of animal species in this metacommunity Rodriguez-Tricot & Arim, 2020). Consequently, a border-centre stratification of sample units was not considered. All biomass of the above-ground plant was removed and identified in the laboratory. The area where the biomass was removed represented a negligible fraction of the pond area, and the locations of the quadrants were not sampled repeatedly over years. A pond was excluded from the present analyses because it corresponded to a permanent wetland. Thus, we had a total of 599 spatial-temporal communities corresponding to 60 ponds sampled during 22 campaigns over 14 years. During this time, M. Arim was responsible for all surveys and V. Pinelli led field sampling since 2014. The taxonomic classification was first led by C. Fagúndez, who was progressively replaced by V. Pinelli. External evaluation was ensured to classify the samples when necessary. In the database conformation, we never had an abrupt replacement in the conformation of the researchers and students involved in the field sampling and laboratory processing, taking care to maintain protocols among sampling events. No permission for fieldwork with plants is required in the study area.

| Trait data
A species-by-trait matrix was constructed from a review of the literature and direct observations (Table S1). In Table 1, the list of traits considered is presented, introducing their description and functional roles. Different traits related to dispersal strategy, competitive ability, drought resistance strategy, life history and tolerance to stress were considered. Correlation in the occurrence of traits is expected, and a reduction in this multicollinearity is important for functional, ecological syndromes and statistical reasons, lack of independence.
Consequently, a principal coordinate analysis (PCoA) based on Gower distances was performed with the trait matrix using the ape package in R (Paradis & Schliep, 2018). The community-weighted means and the community-weighted variances were estimated for each PCoA axis. These values are the mean and variance, respectively, of the community trait values-PCoA axes-estimated among all the individuals sampled in the community. The average and variance in community-weighted traits are expected to systematically change F I G U R E 1 Hypothesized direct and indirect determinants of trait-mediated mechanisms versus stochasticity in community assembly. Hypotheses that predict opposite patterns are indicated by the same number and different letters (H3A and H3B; H4A and H4B). along environmental gradients in response to trends in the selection profile (Loranger et al., 2018;Shipley, 2010). For the estimation of community aggregated moments, abundances were estimated by adding species occurrences for each pond during the study period.

| Community assembly by trait selection
In CATS, trait states are related to the relative abundance of each species from a regional pool via selection coefficients estimated with abundance-trait regressions (Warton et al., 2015). Metacommunity abundances are used as a prior distribution that is incorporated as an offset into the model (Warton et al., 2015). Regression parameters represent 'selection coefficients' that relate species abundances or occurrences with traits (Shipley, 2010;Shipley et al., 2006). If the community is neutrally assembled, then species abundances are independent of species traits (Shipley, 2014;Shipley et al., 2012). On the contrary, if all variation in abundance is explained by species traits, then the community is deterministically assembled by the selection of traits. Consequently, for the range of functional traits considered, the fraction of the variation in species abundances related to drift represents a continuous index between 0 and 1 of the assembly of communities by trait selection or stochastic processes respectively (Shipley, 2014;Shipley et al., 2012). The decomposition of deviance from the CATS analysis was proposed as a method to directly estimate the role of species traits, the mass effect of the metacommunity composition and the stochastic drift in the assembly of communities.
For each local community, a CATS analysis was performed (Shipley, 2010;Shipley et al., 2006;Warton et al., 2015). Basic information collected on the structure of the community was the occurrence of species observed in the metacommunity among the quadrants sampled. Consequently, we use logistic regressions to relate the presence or absence of species in each pond with species traits-species scores on the PCoA axis. The abundance of species in the metacommunity was used as an offset variable (Warton et al., 2015) and was estimated by adding observed occurrences to the sampling units among all the ponds. This offset captures the mass effect of metacommunities on local abundances (Shipley, 2014). In addition, the offset accounts for the effect of differences in species abundances on local occurrences, representing a mechanistic alternative to considering species identity as a random variable. The positions of each species along each of the first four PCoA axes based on traits were used as composite trait predictor variables in the CATS regressions. Because species performance can be nonlinearly related to the trait axis, we also considered a quadratic term (Loranger et al., 2018). A logistic regression was fitted for each pond considering the sampling time as a random effect-package 'glmmTMB' of R (Magnusson et al., 2017). We also considered a timeautoregressive model with a mixed effect of sampling date. However, these models frequently failed to converge and, when they did, had a lower performance than a model without an autoregressive component (see Table S2). The values of the logistic model parameters relating the probability of species occurrence with the composite trait variables of each species (i.e. the PCoA axis scores) were calculated and related to pond area, heterogeneity, hydroperiod and connectivity.
F I G U R E 2 Study system. Ponds are formed in land depressions that fill with rainwater every autumn and winter and dry at the end of spring. Ponds are indicated in blue. The inset graph shows the percolation network, a graph that connects all ponds with a minimum linkage distance, used to estimate pond connectivity. The images highlight the heterogeneity in the areas and physical structure of the ponds, and the inset numbers in the images correspond to the pond id. The presence and density of small islands represent a main source of heterogeneity.

| Environmental gradients
Community connectivity was quantified by two centrality metrics, degree and closeness, estimated on a percolation graph, which is a network that connects all ponds with the minimum linkage Euclidean distance required for linkage (Borthagaray, Pinelli, et al., 2015). Degree centrality (direct connectivity hereafter) is the number of direct connections of a local pond with other ponds, and closeness centrality (global connectivity hereafter) is the reciprocal of the average distances of a local pond with all the other ponds in the metacommunity, representing metrics of direct and global connectivity respectively (Economo & Keitt, 2010). The area of the pond was estimated as the area of an oval using the length of the major and minor axes of the ponds. The variation in plant cover between ponds is surpassed by the range of pond areas spanning several orders of magnitude, supporting the use of area as a proxy of community size (Berazategui, 2012). In  visited several times. Heterogeneity was estimated as the number of 'islands', emergent mounds above water level, per metre of the main and minor axes of the ponds (see Figure 2). The average environmental values during the sampling time were used.
A principal coordinates analysis with flexible path adjustments of the distance matrix was used to resume the range of community assemblies observed in the metacommunity (Shipley, 2021).
Community scores on the ordination axes were associated with environmental gradients: area, heterogeneity, hydroperiod and isolation.

| Deviance partition
To estimate the fraction of the variation in community abundance associated with population stochastic drift, deviance decomposition was performed (following Shipley, 2014;Shipley et al., 2012). Following the methods in Shipley (2014), the variation in the local abundance of species associated with drift can be estimated by fitting two different models and retaining the associated pseudo R 2 values. The first model estimated the explained variance R 2 (u) in a model without traits or metacommunity information. This model was the 'maximally uninformative' model, which assumed an equal effect of all species of the metacommunity on the local assembly-using a uniform distribution as offset-and a random permutation of the trait vector (the average pseudo R 2 from 200 randomizations was retained). This randomization provided a permutation estimation of model bias-R 2 > 0 by chance (Shipley, 2014). The second pseudo R-squared R 2 (m,t) was estimated from a model that used observed metacommunity abundances as offset and observed species traits as independent variables. 1 − R 2 (m,t) represents the fraction of abundance not explained by species traits or metacommunity abundance, that is, the fraction of variation in species abundances explained by drift (after Shipley, 2014). However, this drift estimate must be standardized by the expected drift estimate from the first model (Shipley, 2014). Thus (after Shipley, 2014): where the variation in abundances associated with drift was estimated for the 60 communities. This estimate was contingent on the set of traits considered, providing an upper limit estimation of drift (Shipley, 2010). The estimated drifts (R 2 Drift ) for each pond was retained.

| Environmental determinants of the strength of trait selection
Hypotheses about the causal structure that connected environmental conditions, diversity and the niche-neutral assemblage of communities ( Figure 1) were evaluated with path analyses (Shipley, 2016). The amount of variation in abundance explained by drift was related to local conditions-pond area, heterogeneity and hydroperiod-the isolation of the communities, and functional and taxonomic diversity-for example, species richness. Functional diversity was quantified by a set of community-level complementary indices with the FD package (Laliberté & Legendre, 2010;Laliberté et al., 2014). We calculated the observed richness, number of functionally singular species (sing.sp), functional richness (F ric ), functional evenness (F eve ), functional diversity (F div ) and functional dispersion (F dis ). A best subset model selection was used to identify variables that were significantly associated with the strength of stochasticity in community assembly (McLeod & Xu, 2014). As indices of functional diversity could be mutually associated and also associated with the taxonomic richness (De Bello et al., 2021), we only considered indices with less than a 0.8 correlation between them and with the taxonomic richness.
Path analyses were performed with the lavaan package in R (Rosseel, 2012). The purpose of these analyses was to evaluate the set of hypotheses presented in Figure 1

| Trait gradients
The first four axes of the PCoA on species traits retained 88% of the original variability of traits between species. We retained these four axes because considering additional axes only produced a small increase in explained heterogeneity, not capturing large sources of trait differences between species (Figure 3a). The average and variance in the traits weighted by the community changed systematically along the environmental gradients ( Figure S2). These trends support the main role of trait selection in the response of the community to environmental conditions (Figure 3b; Figure S3). The first PCoA of species traits essentially captured a gradient in dispersal traits and adaptation to aquatic environments, with winged seeds and drought-tolerant species at one extreme and vegetative spread and intolerance to drought at the other. The representation of this axis in communities presented a systematic response to environmental gradients in area, heterogeneity and hydroperiod. Large and persistent   (Figure 3a). The representation of these traits was associated with the hydrodynamic regimen of the pond. The third axis was associated with a gradient from cosmopolitan, small and not tolerant to anaerobiosis, to native, large and aquatic species that were preferred in more heterogeneous environments (Figure 3a). Connectivity and internal heterogeneity were associated with changes in the representation of these traits. Finally, the fourth axis was associated with reproduction in the summer period, after the ponds dried, or in spring at the end of the pond hydroperiod. The hydroperiod of the pond and heterogeneity determined the representation of these traits (Figure 3b).
Community-weighted variance decreased with direct connectivity along the four axes and, in general, was positively correlated with spatial heterogeneity (axes 2 and 4) and hydroperiod (axes 2, 3 and 4). On the other hand, the ordination of ponds on the basis of species representation also reflected the potential effects of connectivity, area, hydroperiod and heterogeneity in the trait-mediated assembly of communities (Figure 3c).

| Stochasticity and trait selection
Local communities were located along a niche-neutral gradient, with large differences in the amount of variation in species occurrences explained by traits or drift (0.22 < R 2 Drift < 0.84). This scenario involved a gradient from communities close to a niche assemblage-in which 22% of the variation in species occurrences was explained by drift and the other 78% of the variation was explained by species traits-to communities close to a neutral assembly where species occurrences were loosely related with species traits-84% of the variation in species occurrences was explained by drift and only 16% explained by traits. In particular, this neutral-niche gradient was well explained by environmental variables and community diversity ( Figure 4). Among diversity indices, taxonomic richness, the number of functionally singular species, and functional richness presented correlations greater than 0.8, only considering taxonomic richness in subsequent analyses. The selection of the best subset model selection retained taxonomic richness and functional dispersion (F dis ) as variables related to stochasticity in community assembly. These variables were included as proxies of taxonomic and functional diversity in the path analyses. Similarly, direct connectivity (degree) and global connectivity (closeness) were mutually correlated, and direct connectivity was superior when explaining stochasticity in community assembly, so it was used in the path analyses.

| DISCUSS ION
The determinants of neutral flat-fitness landscapes versus performance-trait associations are a long-standing controversy in biology (Carroll, 2001) and other disciplines (Arthur & Sibani, 2017;Cobey & Lipsitch, 2012). Throughout the 20th century, theories that attempted to understand the evolution of species traits (Wright, 1932), molecular biochemistry (Monod, 1971) and population genetics (Kreitman, 1996), as well as the ecology of individuals (Losos, 2017) and population dynamics (Royama, 1992), converged on F I G U R E 3 Diversity of plant traits and their representation in temporary ponds. (a) Principal coordinate analysis (PCoA) summarizing the multicollinearity in species traits. Traits with large association with the PCoA axes are indicated within the plots. (b) The average (CWM) and variance in community-weighted traits systematically changed along the environmental gradients ( Figure S2), and only significant trends in CWM are presented here. These three sets of results indicate the existence of a large functional diversity in the species pool (a), the potential action of trait-selection processes in community assembly determined by environmental conditions (b; Figure S2), resulting in gradients in the species composition of communities (c). the view of a balance between chance and necessity as the determinant of most biological phenomena. Stimulated by Stephen Hubbell's controversial neutral theory (Vellend et al., 2014), community ecology was probably one of the last areas of biology in which this view was accepted. As the drift-selection balance has become accepted in community assembly, identifying the scenarios that promote a more neutral or trait-assembled community has emerged as a central aim in this field (Bosc et al., 2019;Janzen et al., 2017;Leibold et al., 2019;Mitchell et al., 2019;Shipley et al., 2012;Tucker et al., 2016;Ulrich et al., 2019;Vellend et al., 2014;Viana & Chase, 2019). Attempting to address this question, we focused on the essential differences between stochastic drift and niche assembly: a connection between species traits and species performance (Hubbell, 2001;Leibold & Chase, 2018;Shipley, 2010;Vellend, 2016).
We found evidence supporting the main role of traits in community assembly, with local communities covering a large gradient from stochastic to deterministic assembly. Ponds are ephemeral systems with environmental conditions that strongly change over time and space (Richardson et al., 2022). Therefore, they are considered extreme environments inhabited by species adapted to these conditions (Biggs et al., 2017;Hill et al., 2021). Taxonomic assemblies in ponds were generally proposed to emerge from the selection of adapted species on the basis of indirect evidence (but see Cunillera-Montcusí et al., 2020). With the conceptual and methodological framework of CATS, we explicitly evaluated the role of traits in diversity patterns along environmental gradients. As expected, the large pool of plant species observed in this metacommunity is made up of organisms with traits that ensure its viability in aquatic or semiaquatic environments. However, a large diversity of traits was observed covering different life histories, dispersal strategies, tolerance to drought and competitive capacities. Our results indicate that this functional diversity at the metacommunity level is F I G U R E 4 Hypothesized causal relationships among environmental gradients (pond area, heterogeneity and isolation), taxonomic and functional diversity, and the relative role of niche (trait mediated) versus stochasticity (drift) in the assembly of communities. The numbers in the boxes represent standardized effects; P z is the link probability from the maximum likelihood fitting, and P boot values are the probabilities estimated from Bollen-Stine bootstrapping, which are robust in terms of sample size and deviation from normality assumptions. R 2 values within the variable boxes indicate the amount of variation in the variable that is explained by the path model.
probably supported by different selection regimens among different ponds (Figures 3; Figure S3). Although all of the ponds considered here are ephemeral, the small and isolated ponds are covered with water for a shorter period of time and then dry out and refill during winter and spring. The opposite is true for large ponds, which have deeper and persistent water. The selected traits represented the ability of the species to survive the drying of the ponds during the water-covered phase, the life histories coupled with the water cycle of the pond, the size of the organism and different aspects of the dispersal strategies (Figure 3; Figures S2 and S3). The effect of these environment-dependent selection regimens ( Figure S3 Explicitly, connectivity (Fisher & Mehta, 2014;Fukami, 2015;Orrock & Watling, 2010;Siqueira et al., 2020), taxonomic diversity (Chase, 2010;Fukami, 2015), functional diversity (Enquist et al., 2015;Shipley, 2010) and environmental filters (Cadotte & Tucker, 2017) are here identified as direct determinants of the balance between selection and stochasticity ( Figure 4). However, while stochasticity could be reduced in large communities (Fisher & Mehta, 2014;Fukami, 2015;Orrock & Watling, 2010;Siqueira et al., 2020), we did not find evidence supporting this expectation.
In this sense, the existence of a direct path between the pond area and stochasticity was not supported by the path analyses (Figure 4).
In the following paragraphs, we further consider the empirical evidence about determinants of the trait selection versus stochastic drift balance and the putative mechanisms involved.
Taxonomic and functional diversities are both consequences and determinants of the strength of trait selection and community drift. Trait selection operating through environmental filters reduces the set of species and traits in a local community and consequently reduces taxonomic and functional diversities (Cadotte & Tucker, 2017). In contrast, when trait selection involves limits to species similarity, the local functional diversity is expanded (Adler et al., 2007;Rodriguez-Tricot & Arim, 2020). The positive association between diversity and drift is supported by our results, considering that taxonomic diversity is closely associated with indices that represent functional richness. However, to produce a change in the relative abundance of species, selection must act on individuals with different functional traits (Shipley, 2010). However, we found that functional and taxonomic diversity significantly promoted stochasticity in community assembly. Several mechanisms predicted these positive effects (Figure 1), but functional diversity, which is the substrate for selection processes, was expected to directly dampen stochasticity in community assembly.
In this context, we emphasize that increasing functional diversity may promote the existence of alternative solutions, combinations of traits, for a single selection regimen, determining functional redundancy between species with different traits. As a consequence, the abundance-trait association could be reduced, which reflects the increase in stochasticity but not necessarily a reduced role of traits in species performance. Clearly, this is a result that motivates further attention on theoretical and methodological grounds. Finally, large communities have substantially high taxonomic diversity and physical heterogeneity but low functional diversity, evidencing both positive and negative effects of area on stochasticity. These alternative effects may produce variations in the observed area-stochasticity association among studies, guided by differences in the functional and taxonomic diversity of different systems. Similarly, when these paths are mutually balanced, a weak or no association may be reported despite the strong effects involved.
Our results support the hypothesized trend from niche-based to drift-based community assembly along the gradient of pond connectivity (Ai et al., 2013;Borthagaray, Pinelli, et al., 2015;Brown & Swan, 2010). In particular, the humped effect of connectivity on stochasticity supports both positive and negative effects. Isolated ponds with low connectivity play a greater role in trait selection, probably due to a reduced mass effect and a consequent strong connection between species traits and species performance (Ai et al., 2013;Borthagaray, Pinelli, et al., 2015;Brown & Swan, 2010).
This contradicts the expectation of a larger role for stochasticity in isolated communities (Gilbert & Levine, 2017;Orrock & Watling, 2010;Vannette & Fukami, 2017). A higher dispersal rate incoming to more connected ponds may determine a rise in mass effects, attenuating the role of species traits in local performance, also increasing the stochasticity in community assembly because of species redundancy (Ai et al., 2013;Borthagaray, Pinelli, et al., 2015;Brown & Swan, 2010;Leibold et al., 2004). However, trait selection has again an influential role in community assembly along those ponds with higher connectivity levels. This increase in the traitsperformance relationship could be determined by the availability of species with a more optimal combination of traits for the selection scenario. This availability is not necessarily represented in the index of functional diversity considered here and elsewhere (De Bello et al., 2021). These results add to those of a number of studies that support community isolation as a major determinant of community structure, to a much larger extent than previously thought (Borthagaray et al., 2012(Borthagaray et al., , 2023Brown et al., 2017).
The spatial heterogeneity of the ponds is identified as a main determinant of the strength of stochasticity in the assembly of plant communities. We consider that this effect is determined by attenuation of environmental filters by heterogeneity (Cadotte & Tucker, 2017).
Heterogeneity was here estimated as the density of 'islands' (see Figure 2), a metric associated with spatial variation in depth, soil texture and nutrients (Piñeiro-Guerra et al., 2014). Furthermore, these islands introduce barriers for animal movement, plant vegetative growth, spatial refuges and patches of conditions that favour species coexistence Rodriguez-Tricot & Arim, 2020). The increase in island density should promote the recruitment of more species with different functional traits, attenuating the traits-occurrence relationship and fostering the role of stochastic drift in species abundances. The previous points can explain the increase in stochasticity with the spatial heterogeneity of the ponds, but not the observed reduction in the community-weighted variance with heterogeneity ( Figure S2). This reduction in trait variance may support the action of stronger environmental filters, a scenario in which the increase in stochasticity can also be related with neutral aggregation of species (Holt, 2006;Scheffer & van Nes, 2006). For example, when only plant species with similar traits are able to recruit and the subsequent relative abundances are determined by drift because the variation for the action of trait selection was depleted by the filter. We finally note that the connection between the strength of environmental filters and the role of traits in community assembly is expected, but has been rarely reported, also demanding further theoretical and empirical attention (Cadotte & Tucker, 2017;Keddy & Laughlin, 2021;Vellend, 2016).
Any approach to identifying the mechanisms behind biodiversity patterns has strengths and limitations. The main potential limitation of our selected approach and studies on functional diversity in general is the contingency of the estimated patterns on the set of species traits considered (De Bello et al., 2021;Shipley, 2010). In this sense, our estimation of stochastic drift should be interpreted as an upper bound, since variation in abundance unexplained by traits may include hidden niche mechanisms related to unmeasured traits. However, it should be noted that the set of traits considered herein covers a wide range of potential niche mechanisms related to dispersal (e.g. seed size, shape, shape and dispersal syndrome), competition (e.g. vegetative spread, plant height), herbivory (e.g. leaf size), and local filters (e.g. anaerobiosis and drought tolerance, nitrogen fixation) and proxies for several traits, such as the Sculthorpe and Raunkiaer classification or photosynthetic path. In fact, the representation of these traits and their effect on species occurrences systematically changed along the environmental gradients of the pond (Figures 3 and 4; Figures S2 and S3).
An explicit focus on higher-level processes, selection versus drift, was indicated as an important step in the construction of a general theory (Hubbell, 2001;Shipley, 2010;Vellend, 2016). In this context, a focus on the amount of variation in abundance accounted for by traits (Shipley, 2014) has three main advantages for the empirical analysis of niche-stochastic gradients in community assembly. First, it provides a direct, continuous and clear quantification of the role of trait selection and stochastic drift in community assembly. Therefore, these simple approaches may overcome tests based on particular patterns, such as species abundance distribution (see also Leibold & Chase, 2018;Tucker et al., 2016;van der Plas et al., 2015). Second, the estimated drift from the CATS deviance partition assesses the role of stochasticity independently of the specific niche or neutral mechanism in the assemblage of communities (Shipley, 2010;Warton et al., 2015). Third, the method of deviance partitioning is directly based on metacommunity mechanisms that attempt to be quantified (Shipley, 2010(Shipley, , 2014Shipley et al., 2006Shipley et al., , 2012Warton et al., 2015). In summary, a focus on the trait abundance association may significantly expand the empirical evaluation of the determinants of niche mechanisms and of the relative role of neutral and niche processes in community assembly.

ACK N O WLE D G E M ENTS
This study was funded by ANII grants from Fondo Clemente Estable (FCE 2014-104763) and CSIC-grupos (ID 657725) to MA.
The database was funded by ANII grants FCE 05-076, FCE 2007-054, FCE 2011_7117, FCE 2014 and PEDECIBA grants to MA. AIB is grateful for the support provided by the Comisión Sectorial de Investigación Científica-UdelaR (CSIC I+D-333). This study was carried out in the framework of the European Commission, the PONDERFUL Horizon 2020 project (H2020-LC-CLA-2019-2). VP is grateful for the support provided by ANII and CAP Doctoral Fellowships. We are sincerely thankful for the thoughtful comments from N. Gotelli, P. Marquet, F. Munoz, and particularly with the several rounds of interactions and comments provided by B. Shipley and anonymous reviewers.

CO N FLI C T O F I NTE R E S T S TATE M E NT
The authors declare no competing interests.

PEER R E V I E W
The peer review history for this article is available at https://     Table S1. Species trait database. Table S2. Comparison of autoregressive and non-autoregressive models with a covariance structure of Ornstein-Uhlenbeck (ou), which provides the same result as an autoregressive structure when data are evenly spaced, but also consider data with uneven time separation-some ponds were not observed at all sampling times.