concept datum sharing in category functional programming

This is an excerpt from Manning's book Functional Programming with Kotlin.
As we have seen in Section 2.3, data sharing often lets us implement operations more efficiently due to the immutability of the underlying data structures that we are dealing with. Let’s look at a few examples.

This is an excerpt from Manning's book Functional Programming in Scala.
When data is immutable, how do we write functions that, for example, add or remove elements from a list? The answer is simple. When we add an element 1 to the front of an existing list, say xs, we return a new list, in this case Cons(1,xs). Since lists are immutable, we don’t need to actually copy xs; we can just reuse it. This is called data sharing. Sharing of immutable data often lets us implement functions more efficiently; we can always return immutable data structures without having to worry about subsequent code modifying our data. There’s no need to pessimistically make copies to avoid modification or corruption.[6]
A more surprising example of data sharing is this function that adds all the elements of one list to the end of another: