How do the $node modifications in hook_node_presave persist?
Objects are (mostly) passed by reference in PHP. The $node variable is a stdClass object so any changes you make will be reflected on the original object in memory.

You don't need to do anything special to implement this yourself, just accept an object as an argument to a function as usual and let PHP take care of the rest.