In what amounts to late middle age in television the CBS comedy “How I Met Your Mother” suddenly finds itself a hit.

Seven years into its run this well-regarded series, which returns with a new episode on Monday night, is scoring its best ratings. It is up almost 20 percent this season among the audience that advertisers most want to reach, viewers between the ages of 18 and 49, and now ranks as the No. 8 entertainment show in that category.

Beyond giving comfort to late bloomers everywhere, the performance by “How I Met Your Mother” is proving that the new ways to watch television can sometimes enhance the old ways. Two factors changed the trajectory of the show this year: its early seasons became available on Netflix, and repeats began running on FX, a cable channel with an audience especially well matched to the show’s core viewership.

“It’s very unscientific,” said Craig Thomas, who created “How I Met Your Mother,” with Carter Bays, “but people have told us: ‘I always heard your show was good. I caught up, and now I watch it live on TV.’ ”