It is not until verse 17 that the church clearly and directly comes into the picture by being identified as Israel—the woman remnant. This is how it is translated in the King James:"with the remnant of her seed." This means her "offspring." The offspring are identified in verse 17 as "those who keep the commandments of God and have the testimony of Jesus Christ," who was born to the woman earlier in the chapter. Israel the nation does not keep the commandments of God, nor does it have the testimony of Jesus Christ. Therefore, in the last half of verse 17, the subject has shifted from Israel the nation to the Israel of God—the church.
The Messiah, who was born of the woman, most definitely kept the commandments of God. The remnant that was born of the woman (identified as her offspring, just like the Messiah), is also clearly distinguished and separate from her, and they too keep the commandments and have the testimony of Jesus Christ.
Now putting verse 17 together with verses 7 through 12 shows that the church (the woman's offspring) will undergo some measure of persecution within Israel (the woman, the nation) before Israel the nation flees. This is very clear, because verses 7 through 11 come before verse 14 in time. If this is not true, then why does verse 11 say that "they overcame by the blood of the Lamb, and they loved not their lives unto death"? That indicates a pretty harsh persecution within Israel the nation.
The whole subject of chapter 12 is Israel the nation, except for those mentions of keeping the commandments, the blood of the Lamb, and having the testimony of Jesus Christ, which appear in verses 11 and 17. So what do we learn from this chapter? That through the great expanse of time—from the time that woman [the nation] flees into the wilderness until verse 17 (an expanse of about two thousand years), Israel the church [the Israel of God] is within Israel the nation, wherever it is. This is not at all unusual.
Verse 17 then clearly infers that the dragon leaves the woman [the nation] who fled and goes some place else to persecute those who keep the commandments and have the testimony of Jesus Christ. It is at this point that a switch occurs between Israel the nation and the Israel of God (the church). Otherwise, why would it say that Satan leaves the woman that he is persecuting and goes to persecute those who have the testimony of Jesus Christ and keep the commandments? By this time, in verse 17, they have separated from one another. The nation and the church are in different locations at the time verse 17 takes place. If I can speculate, the church has gone to its place of safety that is different from where God caused the nation to flee.
John W. Ritenbaugh
Where Is the Beast? (Part Four)