drupal_render() vs drupal_render_children()? What is difference in functionality between drupal_render() and drupal_render_children() ?
When I used drupal_render for $form derived as follows from hook_theme 

function hook_form_alter($form,&amp;$form_state,$form_id) {
if ($form_id == 'content_type_a') {
  $form['#theme'][] = 'custom_content_type_a_node_form'; 
}


}


function hook_theme() {
  return array(
    'custom_content_type_a_node_form' =&gt; array(
       'render element' =&gt; 'form',
    );

}


Then inside a THEMENAME_custom_content_type_a_node_form

function THEMENAME_custom_content_type_a_node_form(&amp;$variables) {
$output = '';
$form = $variables['form'];

$output = &lt;div&gt;Some HTML code&lt;/div&gt;;

$output .= drupal_render($form);

return $output;
} 


While using drupal_render in the above function the page was going into loop and function was being called by endlessly
But when I replaced that with drupal_render_children($form) it did not go into an endless loop
What is the reason for such a behavior?
drupal_render() renders an item. Rendering it contains theming it. Look into function's code, there is this line:

// Call the element's #theme function if it is set


So placing render inside theming function is bound to make a loop. drupal_render_children() exist to break this loop - it renders element's children only, so you can print element itself in theming function and still have children themed by their own proper functions.