Biodiversity can increase or decrease for three main reasons
Succession over time, a community of organisms changes its habitat, making it more suitable for other species. The change in the composition of a community over time is called succession. It increases animal biodiversity but ultimately decrease plant biodiversity.
Natural selection can generate overtime and change biodiversity.
Human influence: In many areas of the world, human activity has made the environment less hospitable to living organisms. It has decreased the biodiversity and, in many cases, led to extinction.