what does X mean vs what does it mean X

Your intuition that it is about length is spot on. One of the reasons to use a cleft sentence is certainly to ease the burden of processing a long descriptive phrase. It lets the right tail of the sentence extend longer so that a very heavy phrase/constituent is not in the middle or beginning of the sentence, which is useful in a head-initial language like English.

Picture the case where there is a brief description like "is easy" and a very lengthy subject, like "to learn the rules, experiment with the code, and write your first program". It's hard for a listener to hear this all and then reconcile it with the category "easy". So in this case, it eases that burden to put the description early as a cleft with "It's easy". There isn't a hard and fast rule about how long the subject can be before clefting is mandatory. I would say, at the very least, if the subject has multiple clauses, as in my example, clefting is preferred.

It may also just be the speaker's choice. Placing words at the beginning sets the topic/setting for a listener, and placing words toward the end of a sentence naturally cues a listener to pay more attention to that part, either because it is new or emphasized information. Clefting a sentence helps with this process.

Keeping the Othello theme, To learn the rules is simple, but to master the game is hard emphasizes the contrasting qualities, assigning simple to the rules and hard to mastering, concepts the listener may already distinguish.

It's simple to learn the rules, but hard to master the game focuses on the contrast of learning and mastering, putting them in to categories of simple things and hard things, categories which the listener may already understand.