Topos theory has developed from the study of sheaves. Sheaves arose in geometry as coefficients for cohomology and as descriptions of the functions appropriate to various kind of manifolds (algebraic, analytic, etc.). Sheaves also appear in logic as carriers for models of set theory as well as for the semantics of other type of logic.
Grothendieck introduced a topos as category of sheaves for algebraic geometry. Subsequently, Lawvere and Tierney obtained elementary axioms for such (more general) categories.