Allegory and typology differ because allegory wholly removes the meaning of one thing and replaces it with another but typology builds and uses parts of that meaning. For instance, Hagar in Gal. 4 represents Mt. Sinai; the meaning, “a woman named Hagar” is removed and replaced with “a mountain where the law was given.” But typology would use parts of the meaning of the type while “unpacking” or “increasing” or “adding to” that earlier type. Jesus and Adam are a good example; both men are founders of a humanity (same meaning) but Jesus is God (additional meaning added) and not the founder of sinful humanity (like Adam) but of righteous humanity. Allegory need not be historical, but typology must. Take Hebrews 11:16’s report that persons of faith seek a better country, a heavenly one and the heavenly Jerusalem. The earthly land and city of Jerusalem are historical places, and they act as types for their heavenly correlates. Moses was told this long along in the Book of Exodus: 25:40:
“And see that you make them after the pattern for them, which is being shown you on the mountain.”
The author of Hebrew expands,
“They serve as a copy and shadow of the heavenly things” (Heb. 8:5; 9:23)
Moses saw heavenly realities on the Mountain of God, Sinai, and God commands Him to create the Tabernacle and all that was in it “after” these heavenly patterns He saw. Similarly, God crafted the history around Jerusalem so that it stood for God and as the City of God. This historical reality then acts to help us think about the heavenly reality waiting to be revealed during the eschaton, when heaven meets earth (Revelation 21).