Abiotic and biotic processes shape species distributions and ecological communities across spatial scales