Add captcha to webform
To captcha protect a webform you NEED to add a captcha element to it. When captcha contrib module is enabled on your site the available captcha challenge types are available to be used on a per webform basis.

The template twig file is mostly for design puproses. 

If the placement of captcha within the form is not to your liking you should copy the default webform template from /modules/contrib/webform/webform.html.twig to your theme /themes/custom/MYTHEME/templates/webform--WEBFORM_MACHINE_NAME.html.twig and perhaps place each element seperately.

The default webform.html.twig is

&lt;form{{ attributes }}&gt;
  {{ title_prefix }}
  {{ children }}
  {{ title_suffix }}
&lt;/form&gt;


And in our own copy we should take out {{ children }} and replace with individual elements but also we have to make sure form ids and actions are included manually and it the final template should end up looking similar to this 

&lt;form{{ attributes }}&gt;
  {{ title_prefix }}
  {{ element.elements.first_name }}
  {{ element.elements.last_name }}
  {{ element.elements.captcha }}

  {# necessary elements #}
  {{ element.form_build_id }}
  {{ element.form_id }}
  {{ element.actions }}

  {{ title_suffix }}
&lt;/form&gt;


Where captcha for example is the machine name of the captcha field