והביאך השם אלקיך אל הארץ אשר ירשו אבותיך וירשתה והיטבך והרבך מאבותיך - The gemara [yevamos 82] derives from the two mentions of the concept "yerusha" that the Jews will have two inheritances but not a third. Rashi and most other rishonim learn that the reason is that the first kedusha of Eretz Yisrael of עולי מצרים was nullified after the churban. The second kedusha of עולי בבל was never nullified and therefore there will never be a third kedusha.
This is the opinion of Rebbe Yosi but Chachomim argue and say that the second kedusha was only temporary and was nullified with the churban habayis.
There is a machlokes rishonim about halacha li-myseh. Tosfos, Sefer Hatrumos and Sma"g hold like Chachomim that קדושה שניה בטלה and therefore trumos and maasros in our times is מדרבנן. The Ramabm and the Raavad hold like Rav Yosi, that the קדושה שניה was never nullified. According to the Raavad the chiyuv of trumos and maasros is מדאורייתא. According to the Rambam it is not מדאורייתא for a different reason - it says כי תבאו and in the time of Ezra all of the Jews didn't come and so it wasn't ביאת כולכם. The Raavad commented that כי תבאו is not stated in the context of trumos and maasros.
To summarize:
Tosfos - Trumos and maasros were מדאורייתא during בית שני and after the churban they became מדרבנן because of ביטול קדושת הארץ.
Rambam - Trumos and Maasros are מדרבנן even during בית שני because we didn't have ביאת כולכם.
Raavad - Even after the churban it is מדאורייתא because קדושה שניה לא בטלה.
The reason Rav Yosi makes a distinction between קדושה ראשונה and קדושה שניה is because [according to the Rambam] קדושה ראשונה was achieved through כיבוש and since it was taken back through כיבוש the original capture was nullified. The קדושה שניה was achieved through חזקה and settlement [the Jews were given permission by כורש] and even after the churban there was still settlement in ארץ ישראל so the קדושה remained intact.
The Kesef Mishna asked, why should the קדושה ראשונה be any less than the קדושה שניה - during the קדושה ראשונה there was also חזקה? So even after the כיבוש us בטל the חזקה remained?!
Rav Chaim answered by showing the source for the Rambam in a Yerushalmi [Shviis 6/1] that expounds the end of the aforementioned pasuk "הטיבך והרבך מאבותיך" - You are better than your forefathers, they [during the first כיבוש] didn't have the yoke of foreign rule while you have their yoke. Meaning, that your hold on Eretz Yisrael during ירושה שניה is through חזקה and despite the fact that you lack כיבוש. This answers the Kesef Mishna's question because we learn from here that during קדושה ראשונה the כיבוש was a necessary component and when it was nullified, the קדושה was similarly eliminated. קדושה שניה was greater in that all that was necessary was חזקה.
With this principle, Rav Chaim explained the discussion in the gemara [gittin 8; avoda zara 21] with respect to Syria if כיבוש יחיד is called כיבוש and it sanctifies the Land or not and we pasken that it is not considered כיבוש [Rashi - כיבוש יחיד is where Dovid captured for his own purposes, see Tosfos who argues]. Asked the Mishna Lamelech [תרומות סוף פרק א]: The gemara is talking about whether during the time of the tanaim and amoraim, Syria obligated in trumos and maasros מדאורייתא or מדרבנן. If so, why do we care if it was sanctified in the time of Dovid or not, קדושה ראשונה was nullified in any case and all we have to know is if Syria has קדושה שניה of עולי בבל. It is thus irrelevant whether כיבוד יחיד is considered כיבוש or not.
Answered Rav Chaim according to the opinion of the Rambam, that indeed עולי בבל settled -חזקה וישיבה in Syria but it wasn't כיבוש, and we explained that חזקה only works to sanctify the land if it is ירושה שניה. If so, it is VERY relevant whether כיבוש יחיד in the time of Dovid was a valid כיבוש because if it was, then the כיבוש of Syria in the time of עולי בבל was ירושה שניה and חזקה alone sufficed and the obligation of trumos and maasros would be מדאורייתא. If it wasn't a valid כיבוש in the time of Dovid then the capture of Syria of עולי בבל was considered ירושה ראשונה in which case the חזקה was not enough and the obligation of trumos and maasros would be מדרבנן.
Let's add a point with respect to the idea that חזקה is enough for ירושה שניה based on Rav Aharon Kotler [Mishnas Rebbe Aharon Zraim 7] and Rav Chaim: First we have to know that ארץ ישראל contains two types of kedusha with respect to the mitzvos of the land. There is a kedusha that occurs through כיבוש and חילוק that pertains to trumos and maasros. There is a second type of fundamental kedusha that pertains to the very essence of the land - the עצם חפצא - that stems from the acquisition of ארץ ישראל by אברהם אבינו that isn't contingent on כיבוש. Based on this the achronim explain the gemara in ksubos [25b] that challa בזמן הזה should be מדאורייתא [if not for the necessity of ביאת כולכם] even according to Chachomim that קדושה שניה בטלה because during the seven years of כיבוש and seven years of חילוק the Jews kept the mitzva of challa. What, pray tell, do the years of כיבוש and חילוק have to do with challa בזמן הזה? The answer is that from the fact that they were חייב in חלה before כיבוש and חילוק it is clear that the obligation stems from the kedusha of the עצם חפצא of the land as it says in the Yerushalmi [חלה] that according to Rebbe Elazar wheat that grew before they entered the land is considered as if it grew בחיוב, and that stems from the קנין of אברהם אבינו. So we see that there is a fundamental, basic קדושה to the עצם חפצא of ארץ ישראל.
Rav Aharon added that when the sifree says [parshas ekev] that wherever the Jews captured as a community has status of ארץ ישראל and is obligated in מצוות התלויות בארץ not only does it now have the קדושה of land that is contingent upon כיבוש but also becomes a חפצא דארץ ישראל through this כיבוש. The nafka mina is that even if the כיבוש is nullified from that place the status of kedusha as a חפצא דארץ ישראל remains intact.
This deepens our understanding of the drasha from והטיבך that קידוש שני is valid even without כיבוש. Since the status of ארץ ישראל has already been effected by the previous כיבוש it is now enough to settle without actually capturing. It emerges that the law of והטיבך והרבך מאבותיך us not merely a distinction between the first and second yerushos but that the moment the status of חפצא דארץ ישראל falls on a certain area all that is necessary in the future for the obligation of מצוות התלויות בארץ is settlement even without כיבוש.
To be continued - I hope:-)
[Based on a shiur given in Har Nof by HaGaon HaRav Ariav Ozer Shlita, Rosh Yeshivas Itri on Shabbos Parshas Nitzavim תשע"א as recorded by HaRav Yosef Ben Arza Shlita]