generation: the people who belong to one stretch of time, or the stretch of time itself
Greek had no single word for our calendar century or decade, so it measured history in human terms: a generation was the people alive together at one point, and by extension the span of years they shared. The word keeps both edges. Sometimes it points at the people (the crowd standing in front of Jesus), and sometimes at the period (the run of years from one named ancestor to the next). The two are really the same idea seen from different angles, which is why the same word does both jobs.
In the Gospels the people sense dominates, and it almost always comes with a verdict. Jesus repeatedly addresses or describes his contemporaries as a group with a shared character, and the character is bad: faithless, twisted, adulterous, looking for a sign. Here the word is close to calling them a breed or a kind of people, not merely a date on a timeline.
Elsewhere the word simply marks off periods of history, one after another. It can name the links in a family line (so many generations from Abraham to David), the years of a single person's lifetime, or the long sweep of ages past and to come. When the phrase is plural and open-ended (to all generations), it is reaching for the idea of forever.