Our parsha begins with the possuk, And Hashem said to Avram, "Go out from your land and from your birthplace and from your father's house, to the land that I will show you". Rashi explains, "Go out -for your benefit and for your good, and there I will make you into a great nation, but here you will not merit having children."
Rashi teaches us here that Avram's being in his birthplace and in his father's house prevented him from having children.
The Rashi on the next possuk, however, seems to contradict this. Hashem promises Avram that H. will make him into a big nation. Rashi explains the reason for this promise is because "being on the road" usually diminishes the chances of having children. Therefore, Hashem promised Avram that in his case this will not happen but rather he will become a great nation.
From this Rashi it seems, the fact that Avram was traveling is the reason that Avram will not have children, and not just remaining in the land of his birthplace! How do we reconcile these two statements?
Zera Shimshon explains in light of a dispute in the Gemara (Rosh Hashanah 16b). "Rebbi Yitzchak said: Four things annul a person's (bad) verdict; tzeddakah, prayer, change of name and change of conduct. Some opinions add that relocating where a person lives also helps annul a verdict. Rebbi Yitzchak brings a proof “Now Hashem said to Avram, Go out of your country, and it proceeds, and I will make you a great nation". Rebbi Yitzchak asks, why does the other opinion not bring this proof? In the case of Avram's moving to Eretz Kenaan, it was the merit of Eretz Yisrael which helped him have children.
According to Reb Yitzchak only moving to Eretz Yisroel changes the decree of a person and according to the other opinion moving anywhere helps.
In light of these two opinions Zera Shimshon reconciles the seeming contraction in Rashi. It was clear that in order for Avram to become a great nation he had to leave his birthplace. According to the opinion who argues with Rebbi Yitzhak, it would be enough for Avram to move to a place that is close to his birthplace. It would be far enough away to be considered that he relocated, to annul the decree that he can't have children, and there would be no problem that traveling diminishes the chance of having children. (This is what the first Rashi is referring to.)
However, Rebbi Yitzchak argues and holds that simply relocating is not enough to annul a bad decree. Therefore Avram could not rely that the decree to be childless would be nullified if he only moved close to home. He had to move to Eretz Yisroel so the merit of living there would help him have children. However there is a problem to travel so far because "being on the road" diminishes the chance of having children. Therefore, Hashem promised Avram that in his case this would not be, Avram will become a great nation.