Where does the $node get its field values after a node edit page has been submitted?
It looks like the actual work to attach the fields to entity objects is done in the _field_invoke() function, right at the bottom with these lines:

if ($items !== array() || isset($entity-&gt;{$field_name}[$langcode])) {
  $entity-&gt;{$field_name}[$langcode] = $items;
}


That doesn't make a lot of sense out of context so it's worth having a look at the whole code for the function.

The basic workflow is:


The node form submit handler calls field_attach_submit()
field_attach_submit() calls _field_invoke_default()
_field_invoke_default() calls _field_invoke()


The entity object is passed through all of those functions and once they're run all fields are attached to the object.

I know it's not much to go on but hope it helps.