While the existing action hooks were first modified to create and query a global variable to determine whether or not they should load scripts and output code to the page footer, the bulk of the work is actually done by the filter function that gets associated to the_posts hook. This function receives an array of all the posts and pages that are destined to be displayed and must determine if a special keyword is present to set the load_scripts variable appropriately.
As you can see from the recipe's code, the text that we chose to look for, [popup], is a shortcode. While we could have selected any text as the trigger to display a pop-up dialog, we chose a shortcode, since it would be easy to make it disappear by providing a simple rendering function for it that returns no content.