Why does the_post_thumbnail output full sized images after activating post-thumbnails support?

the_post_thumbnail is unfortunately named, because it suggests a small image but actually refers to the featured image of a post. Adding support for it simply makes the ‘featured image’ box available in your post editor.

Now, if you look at the source code, you see that if there is no size specified when calling the_post_thumbnail, the size is defined as post-thumbnail. However, this is not the name of the default thumbnail generated for every image, which is thumbnail. There is no image size called ‘post-thumbnail’ generated by default. As a result, WP will use the full image.

There are several ways to get around this, but the easiest would be to use a filter available in get_the_post_thumbnail, the function that is used by the_post_thumbnail. You can reroute the default call from ‘post-thumbnail’ to ‘tumbnail’ like this:

add_filter ('post_thumbnail_size','wpse275569_post_thumbnail_size');
function wpse275569_post_thumbnail_size ($size) {
  if ($size == 'post-thumbnail') $size="thumbnail";
  return $size;
  }