How did 閒 end up becoming 閑 and 間? I can understand the link between 閒 and 間/间, being the empty spaces where moonlight or sunlight can shine through the doors --&gt; empty space.
But how did this 閒 also end up becoming similar to 閑/闲? And how does a &quot;moon behind the door&quot; or &quot;tree behind the door&quot; correlate with the meaning of &quot;free time&quot;?
Outlier

PY xián (or jiān, jiàn)
FORM
閒 originally depicted a door (門), such that the moon (月) could be seen through a crack in the door, indicating the original meaning “crack, split.”
COMPONENTS
門
In 閒, 門 “a double-sided door; door, gate; opening” is a form component, pointing to the original meaning “crack, split.”
月
In 閒, 月 “the moon” is a form component.
MEANINGS
xián
1 (orig.) crack, split
2 ○ leisure, free time
jiān
1 → room, space (same as 間)
2 ⇒ duration of time
jiàn
1 → space in between (same as 間)
2 ⇒ separate

The reference they give:

p. 837
季旭昇，2004《說文新證》，台北：藝文印書館印行，2014年9月第二版。

It looks like the entry in Xinzheng actually begins on page 836. Here is the combined original




The idea of free time is another phonetic loan again. Seems a bit climatic, I know.

Here is p. 1043《字源》talking about 閑



The last sentence is quite interesting.

如今“閒”废止不用，“閒”的空间义由“间”表示，閒的空暇义由“闲”表示。


閑 was originally a character that meant, &quot;fencing around a door.&quot;
閒 was orignally a character that meant, &quot;crack/split.&quot;
閑 was borrowed for it's sound to indicate, &quot;free time.&quot;
間 has derivative meanings of &quot;room/space&quot; from the idea of &quot;crack/split.&quot;