What is the benefit of using an IIFE to create a module? [closed]

I am a JS beginner looking at this lesson on freeCodeCamp:

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/use-an-iife-to-create-a-module

Here is the code in the example they provide:

let motionModule = (function () {
  return {
    glideMixin: function(obj) {
      obj.glide = function() {
        console.log("Gliding on the water");
      };
    },
    flyMixin: function(obj) {
      obj.fly = function() {
        console.log("Flying, wooosh!");
      };
    }
  }
})();

I do not see what the benefit of using an IIFE is here. If we just directly assign the object to motionModule (instead of executing an IIFE that does one thing – return that same object) not only is it easier to read but it saves us a step (we don’t need to execute the IIFE).

So what is the benefit here? I had a bit of a chat with ChatGPT and it was saying a couple of things, some of which I list below:

  1. In the IIFE approach the methods names won’t interfere with outside method/function names. Is that not the same with the “non-IIFE” approach (i.e just assigning the object to motionModule directly)? In both approaches, the methods are kept to the context of that object, so if you create functions with the same name outside of that object it wouldn’t matter – there wouldn’t be any conflict.

  2. It also says that in the IIFE approach the methods are not added to the global scope – are they not? When you return the object in the IIFE (which contains those functions – they are properties of the object), it gets assigned to the global variable motionModule, which means the object (and its properties – the methods) are added to the global scope.

  3. ChatGPT also stressed that the methods are private in the IIFE approach, and can’t be accessed from outside the module. I don’t quite understand what this is getting at. Whether you use the IIFE approach or the “direct” approach, the only way to access those methods is through the motionModule object, right? Or is there a way (aside from using the motionModule variable) to access those methods in the “direct” (non-IIFE) approach that I am not aware of?

I know some people don’t like having several questions in one post so my main question is stated in the title: What is the benefit of using an IIFE to create a module?

The code example that lead to this question is found in the example (and link) above and secondary questions I found myself asking while researching the main question can be found in points 1. 2. and 3. However, since I have outlined the main question above I hope this post does not get flagged for not being focused. Please feel free to answer the secondary questions but I think my main question should be clear.

Thanks in advance!