How to create (& pre-populate) multiple “field collection” fields on an ajax call
The form needs to be build again after items_count is changed.

function MYMODULE_form_alter (&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'MYFORM'){
    $form['#attributes']['id'] = 'MYMODULE-form-ajax-wrapper';

    // Handle triggered ajax element.
    if(!empty($form_state['triggering_element']['#array_parents'][0])) {
      if ($form_state['triggering_element']['#array_parents'][0] == 'field_node_reference') {
        $form_state['field']['field_collection_entity'][LANGUAGE_NONE]['items_count'] = '3';
      }
    }

    // Add ajax callback.
    $form['field_node_reference'][LANGUAGE_NONE]['#ajax'] = array (
      'callback' =&gt; 'MYMODULE_ajax_rebuild_form',
      'wrapper' =&gt; 'MYMODULE-form-ajax-wrapper',
    );
  }
}

/**
 * Ajax callback, rebuilds and returns the entire form.
 */
function MYMODULE_ajax_rebuild_form ($form, &amp;$form_state) {
  return drupal_rebuild_form($form_state['build_info']['form_id'], $form_state, $form);
}