Hold that thought.
Several hundred years later, Yahshua is at the city of Caesarea Philippi with his young disciples, who were probably embarrassed to be at such an ungodly center of smut, wondering what in the world their rabbi was thinking to bring them here. This city was to Pan-worship as the Vatican is to Roman Catholicism. It was the capital city, the center, of cult worship to the goat-god Pan.
Just outside the city, and perhaps where Yahshua was standing, was a stone slab at the entrance to a cave. From this cave flowed the headwaters of the Jordan River. (In the 19th century, an earthquake shifted the river so it no longer flows from the cave).
Pan (from who's name we get the word "pandemonium") was a fertility god who every Autumn went into this cave which served as the gateway to the underworld, where he would spend the Winter. When Springtime arrived, Pan emerged from this gateway of hell to consort with his wife, Ashtarte ("Easter"), and in copulating with her, his sperm fell to the earth as rain, making the land fertile. His followers worshiped this goat-god on this stone slab in an annual fertility orgy involving all sorts of deviations, including human-goat sex.
Hold that thought.
The word "church" seems to have its origins in one of two sources. One is the Greek word "kuriokon" ("house of the lord" - never used in the N.T., although the root, "kuriokos" - "of the lord" - is used twice: the Supper of the Lord in 1 Cor 11:20, and the Day of the Lord in Rev 1:10). The other source is the even-older Celtic dialects that eventually gave us "kirk" ("church") and "circle". In many ancient pagan religions, particularly in Europe, the gathering places were in a circular form (think Stonehenge).
In either case, both words refer to a place, not to people, but the word used in the New Testament, "ekklesia" ("called out", "assembly", "congregation"), refers to people, not a place.
When the Bible was translated into English in the 13-16th centuries, the European idea of a pagan church/circle meeting place became confused with the Biblical idea of an assembly, and our English Bibles inherited the non-Biblical term "church".
That means that when we read Matthew 16:18 in most of our English Bibles, we get a concept of a place or thing which Yahshua intended to build, rather than a congregation.
Hold that thought.
Or better yet, put all three of these thoughts together.
Yahshua is standing with his disciples near, perhaps even on, the stone slab of a pagan, hellish religion, just outside the "gate" to the realm of evil in which humanity is destined to be trapped without a savior. He's speaking to a group of kids who were well-familiar with the story of Samson, who had broken through the gates of the city, in which he would be destined to death if he had not escaped.
In this context, Yahshua stands on or near this stone slab and makes an announcement to Peter that these gates of hell will not prevent his people from being called out of their death-trap, nor prevent his people from going into the depths of hell and defeating the evil therein.
Here's what he says:
On this stone slab, I will edify the people I call out; and the gates of hell will not be strong enough to withstand their attack.