First thing I want to address is the location of Gerar. I believe Gerar has previously showed up, but I didn't pay much attention to it. From the text, we can roughly deduce that Gerar is in southern Canaan (modern Israel), possibly in the Negev, and very close to Gaza/Sinai. Genesis 10:19 says, "The territory of the Canaanite extended from Sidon as you go toward Gerar, as far as Gaza". Sidon is in the north, so this verse is showing the north->south disposition of the Canaanites. Genesis 20:1 says "Now Abraham journeyed from there toward the land of the Negev, and settled between Kadesh and Shur; then he sojourned in Gerar." So Gerar is definitely in the far south of modern Israel.
Second, something I mentioned in a prior section is that this chapter parallels Abraham's visit to Gerar and subsequent negotiations in Genesis 20-21. From a conservative perspective, this is interesting. There is the interesting issue of how the king has the same name, Abimelech, and how the commander also has the same name, Phicol. The simplest explanation (which is often proffered) is that these names are customary for the officials who hold these roles, much like how in modern times the Catholic Popes will take on alternate customary names when they ascend to the role, as well as monks and nuns in various Catholic orders.
It's also interesting how the spur of all this was a famine in the land, just as "in the days of Abraham" (v. 1). This is also a parallel, but with an obvious natural explanation in that the country was subject to repeated famines both in the bible and in historical records. There is another famine in the days of Jacob, and the prophets of the OT repeatedly mention famines as punishment for disobedience. The spectre of famine, based in lengthy droughts, was a fact of life for Israelites of many generations.
While Isaac prayed for his wife and avoided that snare of his family, he does not avoid the temptation to deception. He lies to Abimelech about his wife, with the exact same fear and motivation as Abraham his father. One of the biggest differences is that God speaks to Isaac and tells him to stay in Canaan, and he does. In Genesis 12, there is a famine and Abraham goes to Egypt, where he lies to the king. Of course, this was just after God gave Abraham his first promise, so it's reasonable to say he should have known to stay in Canaan, while this is one of the first recorded times that God directly speaks to Isaac.
In fact, that's pretty important in its own right. We have seen the last 14 chapters of God speaking to Abraham, but only now are we entering the story of God's interaction with Isaac, and the continuation of the promises given to Abraham. Abraham is dead; he did not see all of the promises given to him fulfilled in his lifetime, so we are now in a position where Isaac as the promised son must be the carrier of those promises. This is the first time God speaks to Isaac, so God must share the blessings that Abraham passed down to him, and now the burden is upon Isaac to carry those blessings and walk in the ways of his father Abraham to establish the blessings. This is very important because it is applicable to modern life: there are many people who will not see the promised blessings of God established in their lifetimes, because the promises are greater than what can be fulfilled in one life. Yet the promises are not broken, they are passed down to the next generation, to our children. This is a central theme to Christianity (and to a similar extent, Judaism), and it is addressed both implicitly and explicitly later in the Bible.
Abraham's role in this story has finished. His obedience was made complete, primarily when he followed through with God's command to sacrifice Isaac, and therefore he walked in a very great extent what God has planned for him in life. This is why he is called the Father of Faith. But now his part in the story is over, and God hands over Abraham's promise to the one who was next responsible for it, Isaac, the promised son. Isaac was himself an embodiment of the greater promise (father of nations), though he was only a single child. Now he, as a person, has to take on responsibility for what was promised to his father. So the promised one himself becomes the keeper of the promise.
Note how when God speaks to Isaac, he even uses similar expressions to his promise to Abraham, such as "I will multiply your descendants as the stars in heaven". So throughout this whole chapter, we see time and time again how pervasively Abraham's legacy is impacting Isaac's life. This, too, seems like such a common story in modern life, how both the blessings and the promises given to our parents (v. 2-5) and the problems and faults (v. 1, 7), and then even the battles that are fought (v. 18-21) are passed down to us, their children.
Back to the story. Isaac lies to Abimelech, but eventually gets found out, and Abimelech seems to forgive him and orders everyone to not kill him (seems nice to me). Then something bizarre happens. During the famine (v. 1) Isaac sows and reaps 100-fold. This is insane, and quite possibly exaggerated, because a 100-fold return on your crops is unusual even in a good season. But regardless of whether it was precisely 100x or maybe just 10-20x, what's clear is that Isaac prospered, as that verse says.
(I think I mentioned this before, but frequently in the OT material wealth is used to signify spiritual blessings or providence, and the righteous are often promised great wealth, particularly in the Mosaic Covenant. Some later passages will begin to equate wealth with pride, but we aren't there yet.)
Then once he becomes wealthy, we start to see resistance and opposition, which is sensible because throughout human history, wealthy neighbors are usually the sorts of people that are capable of dominating their neighbors and thus threatening.
Isaac digs up the wells of his father Abraham. So again we see Isaac reconnecting with his father, now in a physical inheritance, but this can also symbolize Isaac reconnecting with his father spiritually, in acceptance of the promises. Notably, these wells were present inside the promised land, so we have seen Isaac's obedience to the message delivered at the beginning of this chapter. This obedience also explains his material abundance and blessing.
He quarrels a bit, and then goes to Beersheba, the well of the oath, where Abraham previously made an oath with Abimelech and also built an altar to the Lord. This is definitely one of the holy places of the Lord, and the Lord appears to Isaac here and speaks to him, reaffirming the promise. Isaac again follows in his father's footsteps, building an altar and having a well dug. Wells represent permanence to the highly mobile shepherds of the time, because normally they would travel from place to place. You would only dig wells (which are deep and laborious projects) if you had a firm expectation that you would either stay there, or come back. You don't dig wells for other people. That's why it's significant that Isaac re-dug his father's wells, because the Philistines were trying to shut off the generational inheritance in the land.
It reminds me of a news story I heard recently where the Foreign Minister of Israel (the modern nation-state) went to a ceremony where they planted a tree in some contested area like East Jerusalem or something (I forget where), and it enraged a bunch of people for the same reason the wells are so contentious to the Philistines. When you plant a tree, it's because you plan to be there in 40 years when it starts bearing fruit. If it's contested ground, then read between the lines.
Anyway, things don't get quite as negative in this story. Isaac makes another covenant with Abimelech, and things remain peaceful. For now.