Origins
Habitat is a Latin verb masquerading as an English noun.βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ In Carl Linnaeus's 18th-century taxonomic system, each species description included a line beginning 'Habitat in...' β Latin for 'It dwells in...'. English naturalists borrowed the word directly from these descriptions, dropping the rest of the sentence and keeping only habitat as a noun meaning 'the place where a species lives'.
The Latin habitΔre ('to dwell') is a frequentative of habΔre ('to have, to hold'). The logic is that to dwell somewhere is to hold it as your own β to have a place. This connection runs through the entire word family: a habit is something you hold to repeatedly, inhabit means to hold a place within, and exhibit (ex-habΔre) means to hold something out for display.
Latin Roots
More distantly, able descends from Latin habilis β 'easy to hold or manage'. A capable person is one who can be held in hand, metaphorically speaking. Prohibit (pro-habΔre) means to hold something forward as a barrier.
The Proto-Indo-European root *gΚ°abΚ°- meant 'to grab' or 'to take'. From grabbing to having to dwelling: the semantic drift covers the full arc from seizing a place to calling it home. Habitat preserves the middle of that journey β the moment when having becomes inhabiting.