Disentangling the drivers of metacommunity structure across spatial scales