Duplicate copies of a logically-single entity scattered across the codebase — every order carries its own Customer copy that should be the shared customer.
Duplicate copies of a logically-single entity collapse into one shared object that everyone references.
Before the refactoring
// every order carries its own Customer copyorders.forEach(o => o.customer = { name: 'Acme' });
After the refactoring
const acme = customerRepository.find('Acme');orders.forEach(o => o.customer = acme);
Updates to the entity must touch every copy; storage bloats; identity becomes ambiguous (which copy is the canonical one?).
Sharing introduces the question 'who owns this?' — make sure the lifetime and visibility of the shared reference are well-defined.
Updates to the entity are visible everywhere; storage shrinks; identity becomes meaningful again.
Sharing references without clear ownership — introduces lifetime and visibility ambiguities (who owns this? when does it get freed?) that the original value-copies hid.