Programming Ecto: Question on cast |> cast_assoc (page 82)

While reading and following along Chapter 4, we use a map params containing a simple name string key of an Artist schema and a key containing a list with one map for the has_many assoc towards Album named albums.

I am confused by the following:

changeset =
  %Artist{}
  |> cast(params, [:name])
  |> cast_assoc(:albums)

How does the last call get the albums part out of the params map when it has been filtered out by the previous step? When leaving off the last element of that pipe, I get this:

#Ecto.Changeset<
  action: nil,
  changes: %{name: "Esperanza Spalding"},
  errors: [],
  data: #MusicDB.Artist<>,
  valid?: true
>

This does not seem to contain the unused key from the params map anywhere! But somewhat magically, when passing it on to cast_assoc(:albums), it suddenly knows its contents.

Maybe I haven’t grokked the console representation of stuff (that thing starting with #, the struct name, and then its contents enclosed in angle brackets), appearing in orange colour on my terminal. Is that providable by the struct implementation (much like a toString() in Java or __str__ or __repr__ in Python), and Changesets do not include some things they hold on to behind the scenes?