During most of human history, a heavenly hindrance existed that prevented Malchut to reach maturity. I will not go into the mechanics of the hindrance. The Zohar in Parshat VaEra tells us about a thousand minus one streams (Yeorin) that have to be passed. The GR"A teaches that Isaiah 60:22 ("the least shall become a thousand") refers to this 999. The principle is often called תצ''ט, the number 499, because, according to the teachings of the Arizal and the GR"A, the 999 streams split up into 499.5 on the left and 499.5 on the right. The left count is called the count of Din, and the right count is called the count of Chesed (see Kol HaTor, chapter 2:60).
The background of the Din and Chesed counts and their convergence, is what would have been if Am Yisrael would not have drawn Din onto itself in an early stage of its existence. In this scenario, the count to 999 would have been what I will call "a priori", as follows.
A priori, the count on the right is obtained by viewing the 6,000 years of Malchut as 500 times 12. The number 12 denotes Chesed. The planet of Chesed is Tsedek (Jupiter), which revolves around the Sun every 12 years. Every 12 years, in what is called a year of Chesed, Chesed flows to the world. Point zero of the count of Chesed is year 5 of the years of Malchut. That is, at year 17 we count "one", at year 29 we count "two", until year 5993, which is 499. Half a count of Chesed is 6 years, so that 499.5 would be reached in the year 5999.
A priori, the count on the left started when 14 years after entering the Land, Am Yisrael started counting Shmita years. The Land was entered in the year 2489, and the first Shmita period therefore started in 2503. Counting every seven years, 2510 is "one", 2517 is "two", et cetera, one arrives at 499 in year 5996. Half a count of Din is 3.5 years, so that 499.5 would be reached within months from when the 499.5 count of Chesed would be reached.
This would have been, but Am Yisrael sinned. The first collective Sin, to be repaired fully only in the course of history, was the selling of Yosef by his brothers. The Din and Chesed counts both changed in the wake of this Sin. The Din count changed because of the Sin, the Chesed count changed in the merit of its repair.
The Sin of Yosef's brothers shifted point zero of the count of Din to the year 2237, the beginning of the seven years of drought that were to bring the brothers to Yosef. And so, 2244 is "one", 2251 is "two", and 499 is in 5730. In other words, the count of Din became 38 (38 times 7 years) ahead of what it would have been "a priori" and instead of reaching the end of 6,000 years together at 499.5, the two counts cross each other at value 446.5, reached in both counts by the year 5363, with 5366 being the first year of Din surpassing the Chesed count, 22*10 years of Din after 3826 (see Zohar Chadash, Parshat VaYeshev, page 29), the onset of the destruction of Bayit Sheni because of Sin'at Chinam among Yisrael.
Din crossing Chesed before reaching 499.5 would have destroyed the world. However, the holy Arizal achieved the full repair for the Sin of the sale of Yosef through his studies of the secrets of Torah, and the destruction was prevented. The Chesed count was changed such so that the convergence at 499.5 was restored. In addition to every 12 years, also every 19 years became a year of Chesed, starting with year 5309. The combined Chesed count arrives at 499 in the year 5727. Value 499.5 is reached half a count of Chesed later in 5733, whereas the count of Din reaches this value 3.5 years after 5730. The addition of the 19-year cycle to the count of Chesed is an instance of the principle B'Ita Achishena - in its time I will hasten it - (Yeshaya 60:22): When a premature end nears, I will hasten the count of the right.
[It is sometimes thought that the death of Aseret Harugei HaMalchut atoned for the sin of the sale of Yosef. However, this death was in part punishment for a repetition of this sin - the ban of Rabbi Eliezer ben Hyrcanos. As a sign of the Tikun of the Arizal, the banning of Rav Azaryah Di Rossi's magnum opus Me'or Einayim was prevented by Heaven. However, rejection of truth in the name of Torah is a desolating Shikutz. The attempted ban clarifies why redemption could not come at the time.]
That is, the two counts meet at the Yom Kippur war, the turning point of history. As for preceding historical turning points, Israeli independence was declared in the year 5708, which was a year of Chesed due to the 19-year cycle, and Yerushalayim was reunited and Makom HaMikdash regained in the year 5727, likewise a year of Chesed.
Note that the above cycle lengths are known numbers: 19 is the length of the calendar cycle, which has 7 leap years and 12 normal years. The Chesed count added at the time of the Arizal takes place in the 8th year of the calendar cycle, the year in which the solar date of Pesach is later than in all other years.
In terms of Partzufim, the Chesed count is called the count of Malchut, because originally it covers all of Malchut, and the count of Din is called the count of Zeir Anpin, because it started with the advent of Yisrael. The counts to 500 can be viewed as counts to 500/7, close to 72. Four other "72" counts exist, corresponding to four other Partzufim, as we shall see.
[thanks to Gedaliah]
[A reader of this post made this spreadsheet with three tables. The first features the "a priori" counts of Zeir Anpin and Malchut. The second features the change at Mechirat Yosef and the resulting would-be crossing of Din and Chesed at 446.5. The third table features the counts of Zeir Anpin and Malchut taking account both Mechirat Yosef and the Repair.]
יז