The impact of fragmentation on biodiversity is driven by more than the spatial configuration of suitable habitat patches. Habitat is embedded in the surrounding anthropogenic land cover, known as the matrix, which plays a key role in species movement and connects the fragmented habitat. Whether the matrix is a barrier or a conduit to movement depends on the mortality of the moving individuals. However, individuals differ in their behavioural response to the risk posed by the matrix, with the willingness to enter the matrix depending on an individual's risk‐taking behaviour. This individual‐level behavioural variability is rarely considered but represents an additional mechanism shaping inter‐ and intraspecific competition as well as evolutionary behavioural responses. We used an individual‐based model to scale up from individual foraging movements to the resulting community structure of a competitive small mammal community in differently fragmented landscapes. The model interactively considers extrinsic matrix conditions, given as a certain mortality rate, and individual differences in intrinsic movement decisions when moving into the matrix. The model was used to investigate consequences of fragmentation and matrix mortality for species and behavioural diversity. Low matrix mortality resulted in a positive effect of fragmentation on species diversity. At the same time, it led to a high average risk‐taking behaviour. While this was an important adaptive response to fragmentation, it also led to a loss of intraspecific diversity. High matrix mortality reversed the effect of fragmentation, leading to a drastic loss of species with increasing fragmentation. High mortality risk reduced average risk‐taking, especially at high fragmentation. Study findings suggest that the feasibility of movement in the matrix can influence species diversity and evolutionary responses of movement‐related behavioural traits in fragmented landscapes. The matrix may thus play a key role in reconciling contrasting empirical results and provides a promising tool for future biodiversity conservation.