Habitat loss reduces biodiversity, which leads to infectious disease emergence. The way a habitat is fragmented (how many patches it is divided into, how those patches are shaped, and what the distance is between them) further affects the extent of disease emergence. Both the number of divisions of habitat into smaller patches and the irregularity of patch shapes tend to increase habitat perimeter, which in turn increases contact between disease agents and humans.
The hazard is greatest in places with greater pre-existing biodiversity, where there is a greater diversity of microbial pathogens and associated hosts. There is a double risk of developing wilderness areas in these places because there are more pathogens to begin with, and the resulting biodiversity loss tends to amplify disease transmission.
Human encroachment into species-rich habitats may simultaneously decrease biodiversity and increase exposure of people to novel microbes [Wilkinson 2018: 1].
Wilkinson, David A., et al., 2018, Habitat fragmentation, biodiversity loss and the risk of novel infectious disease emergence, J. Royal Society Interface 15, https://royalsocietypublishing.org/doi/full/10.1098/rsif.2018.0403.