The occupation of a habitat or territory by a biological community or of an ecological niche by a single population of a species.