How can I programmatically add webform elements to an existing webform?
So I spent a full day investigating on something similar. Kudos to @jrockowitz for providing the right direction. Below is something I wrote to work.

$webforms = \Drupal::entityTypeManager()
  -&gt;getStorage('webform')
  -&gt;loadByProperties([]);

$new_field = [
   'new_field'=&gt;[ '#type' =&gt; 'textfield',
     '#title' =&gt; 'Question one',]];

foreach ($webforms as $webform) {
     // Applying to all forms.
      if (!in_array('new_field', $webform-&gt;getElementsDecoded())) {
        // $webform-&gt;getElementsDecoded() will get all the previous elements of the webform.
        $new_element_arrangment = array_merge($webform-&gt;getElementsDecoded(), $new_field);
        $webform-&gt;setElements($new_element_arrangment)-&gt;save();
    }
}