Napsal(a) Emanuel Swedenborg
Here are some excerpts from Swedenborg's "Arcana Coelestia" that help explain the inner meaning of this chapter:
AC 2496. In the twelfth chapter above, Abraham‘s sojourning in Egypt has been treated of; by which was signified the Lord’s instruction in memory-knowledges while still a boy. In this chapter the subject treated of is Abraham‘s sojourn in Gerar, where Abimelech was; by which the Lord’s instruction is in like manner signified, but in the doctrinal things of charity and faith. The subject that is especially treated of here is the doctrine of charity and faith in respect to its origin; namely, that it is spiritual from a celestial origin, but is not from the rational.
AC 2497. The Lord‘s state in which He was when He first instructed Himself in the doctrinal things of charity and faith is treated of; the state itself is signified by "Kadesh and Shur;" the doctrine of faith by "Abimelech king of Gerar" (verses 1, 2). That He at first thought in regard to the rational that it should be consulted (verse 2). That still it was not consulted (verses 3, 4, 8, 9). The reasons why He so thought (verses 5, 6, 10-13). That the doctrine of charity and faith is spiritual from a celestial origin (verse 7). That He was so instructed; and that then all things rational, as well as all memory-knowledges, were of service to Him, being like a covering or garment (verses 14-16). And in this way the doctrine was perfect (verse 17). That it would have been otherwise if the doctrine had come from the rational (verse 18).