What's the difference between the container and html_tag render elements? What is the difference between render elements of #type html_tag (set to div) and container in Drupal 8?
Is the container render element, a simpler version of html_tag? Easier for processing to preprocess container elements?
I note that:

historically, html_tag was for void elements in the  tag in Drupal 7.x.
if the container element is used a form, it adds the form-wrapper/js-form-wrapper class and an HTML ID if it has #array_parents.

Perhaps my theories are correct (easier to leave be for historical reason / form element reasons)?
PHP:
  use Drupal\Core\StringTranslation\TranslatableMarkup;

  $variables['myhtml_tag'] = [
    '#type' =&gt; 'html_tag',
    '#tag' =&gt; 'div',
    '#attributes' =&gt; [
      'class' =&gt; 'my-container-class1',
    ],
    'child' =&gt; [
      '#markup' =&gt; new TranslatableMarkup('Some Container text1.'),
    ],
  ];

  $variables['mycontainer'] = [
    '#type' =&gt; 'container',
    '#attributes' =&gt; [
      'class' =&gt; 'my-container-class2',
    ],
    'child' =&gt; [
      '#markup' =&gt; new TranslatableMarkup('Some Container text2.'),
    ],
  ];

HTML:
&lt;div class=&quot;my-container-class1&quot;&gt;Some Container text1.&lt;/div&gt;

&lt;div class=&quot;my-container-class2&quot;&gt;Some Container text2.&lt;/div&gt;
I did &quot;Blame&quot; on the 7.x system.module after I didn't found a clue of 'container' in the 6.x branch. In the &quot;Blame&quot; you can see that Dries himself committed the patch that introduced $types['container'] in 2010 and that it leads back to the following issue on drupal.org:

#557272: FAPI: JavaScript States system

The issue which introduced #states to the Form API! Now let's scan the page for &quot;container&quot;. Okay, comment #36 explains quite a bit of the reason why it was introduced:

As discussed with kkaefer and tha_sun, we switched the &quot;wrapper&quot; Form
API element type to &quot;container&quot; to not get too confused with other
&quot;wrapper&quot; stuff, like &quot;wrapper_callback&quot;, &quot;theme_wrappers&quot;, etc. The
&quot;container&quot; type still uses the CSS class of &quot;*-wrapper&quot; though, to
match with the rest of the Drupal coding standards.

And in the commit itself you then can see how container elements already replace some markup elements (markup being the default if #type omitted) which had '#prefix' =&gt; '&lt;div&gt;', '#suffix' =&gt; '&lt;/div&gt; with hardcoded HTML.
To make it short: Container is a classical wrapper. And more of a form element. Whereas html_tag is more of a render element, traditionally used for void elements, often in the HTML &lt;head&gt;. Like placing meta tags or placing JavaScript and CSS libraries in script tags.