Encapsulation

Wikipedia:

In software systems, encapsulation refers to the bundling of data with the mechanisms or methods that operate on the data. It may also refer to the limiting of direct access to some of that data, such as an object's components. Essentially, encapsulation prevents external code from being concerned with the internal workings of an object.

Encapsulation is often described as just concealing data or restricting access to it, but:

The most important notion [of encapsulation] is that an object should guarantee that it'll never be in an invalid state… The [encapsulated] object knows best what “valid” means, and how to make that guarantee

In some languages, we can disallow changing data after creating using immutable structures. They make it impossible to bring the data to an invalid state from the outside.