Reading about Elixir immutability and how it avoids memory copying wherever possible, it seems like the only possible explanation, but I haven't seen it explicitly stated anywhere. For example, when appending a new element to a list, it is described that the operation takes exactly n steps, with n being the length of the list, but that it only shallow-copies the original. So my assumption is:
Say we have a list [1, 2, 3, 4]. It consists of 4 nodes, but the nodes themselves do not contain the values. 1, 2, 3, 4 are stored somewhere else and each node contains a reference to the corresponding value, as well as a reference to the next node. When we append 10 to the list, not just one but actually five new nodes get created, since in the original list the node for the number 4 has to have 'nil' as its 'next' reference, but in the new list the node for the number 4 has to have 'next' pointing to the newly created node for the number 10. So it can't be reused. And that in turn means that the node for the number 3 also can't be reused, etc. etc. So five new nodes get created, but first four are shallow copies, meaning that they point to the exact same memory locations as the original nodes.
Does what I just described make sense?