This is a mystery.
http://golem.ph.utexas.edu/category/2013/01/from_set_theory_to_type_theory.html
http://ncatlab.org/nlab/show/type+theory
nLab page on Type theory