The details type provides a collapsible area around other elements, similar to a fieldset. Fieldsets can only be used around form elements, whereas the details type can be used outside of them. Take a look at this example:
$form['name'] = array(
'#type' => 'details',
'#title' => $this->t('Name')
);
$form['name']['value'] = array(
'#type' => 'textfield',
'#title' => $this->t('Value'),
);

Detail type