The word is French, from terre, earth. The components usually named are geology and soil, topography and aspect, and mesoclimate. Whether human tradition belongs in the list is where the arguments start.
Why the definition is contested
A strict reading confines terroir to natural factors, on the grounds that including human practice makes the term unfalsifiable — any difference at all can then be attributed to it. A broader reading holds that the practices of a place are inseparable from it, since the grape chosen and the way it is trained are themselves responses to the site. This encyclopedia does not settle it; both readings are in serious use.
How it became law
The French appellation system codified the idea in the twentieth century by making the name of a wine the name of a place, and attaching rules to the place. That structure was copied widely, and it is why so many European wines are named for geography rather than for grape.
What is measurable and what is not
Drainage, sun angle, accumulated warmth and frost risk are all measurable and all demonstrably affect the fruit. The stronger popular claim — that a particular mineral in the soil is tasted in the glass — is not established, and the mechanism usually proposed for it does not survive scrutiny.