What's the difference between the container and html_tag render elements?
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.