`val` is a read-only reference (cannot be reassigned), while `var` is mutable (can be reassigned). `val` does not automatically make the object immutable.
`val` means the reference can’t be reassigned after initialization. `var` means you can point it to a different value later.
That’s about the *reference*, not the object:
val xs = mutableListOf(1)
xs.add(2) // OK
// xs = mutableListOf(3) // not OK
var n = 1
n = 2 // OK