(1) [OP] Is it meant as a summary of what precedes it or as an introduction to what follows it?
That's a very good question. On the face of it, it would appear to be an introduction. This formula, usually referred to simply as the "toledot" formula (from the Hebrew ...אֵלֶּה תֹולְדֹות = ʾēlleh tolədôt... "these are the generations of...") occurs a number of times in the Genesis, and a couple of times beyond it:
Primeval History (1:1–11:26)
2:4 These are the generations of the heavens and the earth
5:1 This is the book of the generations of Adam
6:9 These are the generations of Noah
10:1 These are the generations of the sons of Noah
11:10 These are the generations of Shem
Patriarchal History (11:27–50:26)
11:27 These are the generations of Terah
25:12 These are the generations of Ishmael
25:19 These are the generations of Isaac
36:1 These are the generations of Esau (that is, Edom)
36:9 These are the generations of Esau
37:2 These are the generations of Jacob
Num 3:1 These are the generations of Aaron and Moses
Ruth 4:18 These are the generations of Perez
It's obvious that in every case the formula introduces what follows. Or at least, that seemed obvious until the advent of the Documentary Hypothesis that separated out the sources of the Pentateuch into distinct strands. Those adopting this approach uniformly assigned the Toledot formula (and usually the material attached to it) to the "Priestly" source (known as P).
For most Pentateuchal cases of the Toledot formula (let's call it TF for the rest of this answer), this worked quite well. But Genesis 1-2 presented a particular problem. In the standard source analysis, the P creation account is the one about the "seven days" in Genesis 1, and spilling over into Genesis 2. The at that point, the Yahwist's (known as J, from the German form of the word) account takes over. The "seam" between these two accounts clearly, then, comes in Gen 2:4 itself. In translation:
- "These are the generations of the heavens and the earth when they were created,..."
- is a P formula of introduction, but the P material precedes it
- "...in the day that the LORD God made the earth and the heavens."
- this must then serve as the beginning of the J material that follows
So the standard "scholarly" account has been to say that Gen 2:4a concludes the P creation account, since it is clearly J material that follows. You will typically still see commentaries that structure the opening part of Genesis as 1:1-2:4a, followed by 2:4b-25. Obviously, then, such commentators take the TF as an unusual "conclusion", rather than as an "introduction".1
As long as you're living in Documentary-Hypothesis-land, this works. But it took the work of Brevard Childs to make what must appear to be the obvious point, that if the TF is everywhere else an introduction, then it must be an introduction here, too.2 The implication for this approach, then, is to deepen the sense of the interweaving of the P and J material, since the P formula is clearly (!) being deliberately used as "glue" to hold the "two accounts" together, thus producing what to some would appear to be an anomaly: there is a P introduction to a J passage.
(2) [OP] I’m also not sure what תֹולְדֹ֧ות (tolədôt; ESV, “generations”) refers to in this context.
The semantics of the key term, tolədôt = "generations of", might seem hazy when used in the TF. Its use is not restricted to this formula; it appears at least a couple dozen times to refer explicitly to succeeding generations in a genealogy (e.g. Exodus 6:16, 19; and lots of times in Numbers and 1 Chronicles 1-9). Some of the formulaic occurrences have this character, too (e.g. Gen 6:9; 25:13; 36:9). Others, however, do not -- like our Gen 2:4, but also 5:1 and 37:2. That non-genealogical use then seems odd.
Nor is it the only Hebrew word available for "generation(s)". There is another, דּוֹר dôr = "period, generation", which looks like a near synonym -- and, in fact, might better suit some of our TF contexts. Or so we might think!
Typically, though, the understanding of semantics needs to follow usage. For tolədôt, it is not unusual to find commentators translating more idiomatically a "history of..." -- that is, the TF introduces an account which may (or may not) be "genealogical" per se.3 As Victor Hamilton points out in his article on the term, the formulaic use seems to have the effect of throwing the spotlight on the "progenitor" of the leading figure in the narrative which follows.4 It isn't necessarily the case that it must be a strict genealogy in terms of some "family tree".
There is more that could be said be said,5 but I hope this sheds at least some light on an interesting issue.
- Such is still seen, for example, in the article on ילד [yld] (the tri-literal root from which tolədôt comes) by J. Schreiner, in G. Botterweck & H. Ringgren (eds), Theological Dictionary of the Old Testament (Eerdmans, 1990), vol. 6, pp. 79-80.
- He makes this simple case in his Introduction to the Old Testament as Scripture (SCM/Fortress, 1979), on p. 149. His brief arguments here have generally found favour in later scholarship.
- One such is Gordon Wenham, Genesis 1-15 (Word, 1987), pp. 44, 55-6.
- V. Hamilton, "ילד [yld]", in New International Dictionary of Old Testament Theology and Exegesis, ed. by W.A. VanGemeren (Zondervan, 1997), vol. 2, p. 459.
- See e.g. Martin Woudstra, "The Toledot of the Book of Genesis and Their Redemptive-Historical Significance", Calvin Theological Journal 5 (1970): 184-9; and more recently Matthew A. Thomas, These are the Generations: Identity, Covenant, and the 'toledot' Formula (T & T Clark, 2011).
Update : A new article has just appeared which discusses the anomalous uses of the "formula", including 2:4. See now: Sarah Schwartz, "Narrative Toledot Formulae in Genesis: The Case of Heaven and Earth, Noah, and Isaac", Journal of Hebrew Scriptures 16.8 (2016): 1-36.