In chapter 21 the sword, a common symbol of divine judgment, is about to be unsheathed against Jerusalem and Ammon. It is seen sharpened, indicating judgment is imminent. Verses 18-32 are actually referring to the sword of Nebuchadnezzar. It was his sword that would be used as a means of God's judgment. The phrase "until he come whose right it is" refers to the overturning of Zedekiah's house, the end of David's kingdom until the coming of the Messiah.
Again in chapter 22 Ezekiel names the sins of Jerusalem. He states in this chapter that she defiles herself with idols, sheds blood, profanes the Sabbath, practices robbery, promiscuous adultery, and that the priests and prophets are dishonest, after personal gain.
Chapter 23 records a parable of Israel's idolatry. Aholah is Samaria, and her sister Aholibah is Jerusalem. Samaria represents the Northern Kingdom and Jerusalem represents the Southern Kingdom. In these chapters the relationship between husband and wife is used to represent the relationship between God and His people. The sins of both Samaria and Jerusalem are recorded in this chapter. Samaria (verses 5-10) had politically and spiritually contaminated herself with Assyria by alliances and religious affiliations. Aholibah (verses 11-21) likewise sinned. Their political and religious sin had to be punished (verses 22-35) and the judgment on both Samaria and Jerusalem was forecast in verses 36-49.