> 'the_post_navigation'. It seems to work for Custom Post Types (CPTs) but I cannot figure out how it does this.

[`the_post_navigation()`][1] uses [`get_the_post_navigation()`][2] which uses [`get_previous_post_link()`][3] and [`get_next_post_link()`][4] which both uses [`get_adjacent_post_link()`][5] which uses [`get_adjacent_post()`][6] to get the next and previous post from the same post type. 

If we look at the source code for `get_adjacent_post()`, we will notice that the `$post_type` property from the current post object (*`$post-post->type`*) is used as post type for the SQL query. This is how the links "know" how to get posts from the same post type. Here is the relevant line responsible for this

    $where = apply_filters( 
        "get_{$adjacent}_post_where", 
        $wpdb->prepare( 
            "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type 
        ), 
        $in_same_term, 
        $excluded_terms, 
        $taxonomy, 
        $post 
    );

> I cannot figure out how to get the taxonomy of a Post on a single post page.

The taxonomy would be the the one which the terms are assigned to which is assigned to the posts. This is the custom taxonomy registered by you, or it might be the build in taxonomy `category` or `post_tag`. To learn what taxonomies and terms are, please refer to [this post](http://wordpress.stackexchange.com/a/158223/31545). The taxonomy name you have to hardcode, so you will need to know which taxonomy's terms you need to target and loop through

  [1]: https://developer.wordpress.org/reference/functions/the_post_navigation/
  [2]: https://developer.wordpress.org/reference/functions/get_the_post_navigation/
  [3]: https://developer.wordpress.org/reference/functions/get_previous_post_link/
  [4]: https://developer.wordpress.org/reference/functions/get_next_post_link/
  [5]: https://developer.wordpress.org/reference/functions/get_adjacent_post_link/
  [6]: https://developer.wordpress.org/reference/functions/get_adjacent_post/