Effects of habitat loss and fragmentation on population dynamics