They didn't figure anything out. There's no sentience in the algorithm, only the creators of said algorithm. It only chose content based on input. So it all revolves around the choices of the article's author.
Same thing with the woman who was pregnant, the algorithm gave choices based on the user's browsing history. It made the connection that the choice of product A was also chosen by pregnant mothers, therefore the shopper might be interested in product B which is something an expecting mother would buy.