What exactly do this function declared into functions.php file of a WP theme?

The last line tells WP to run this function on the pre_get_posts hook. That hook is the ideal place to modify the main query that will be run in order to build the page. In this case, exclude_featured_tag() checks whether WP is loading the home page, and whether it’s about to call the main query for the page (as opposed to any other secondary queries being run). Then it modifies the query ($query->set()) to NOT include any post that has tag of ID OF THE FEATURED TAG.

For more on the pre_get_posts hook, see the codex.