structs are basically just maps, so the same applies.
I suspect it is doing s strict equality test behind the scenes. You can read about equality tests here: Kernel — Elixir v1.17.3
How this maps to the Erlang :set code I don’t know without digging, but I would guess the strict equality check is implemented in Erlang rather than Elixir.