Function expression vs IIFE

Function expression vs IIFE

In the first function, which is a function expression,  test.init();  is not working.
  1. var test = function(){
  2.   
  3.   console.log("variable inside test");
  4.   
  5.   // This is a function inside another function (closure)
  6.   var init = function(){
  7.     console.log("variable inside init");
  8.   }
  9.   // returning an instance of init method will expose it to the closure.
  10.   return{
  11.     init:init
  12.   }
  13.   
  14. }

  15. test().init(); // working
    test.init();   // not working - WHY?

But in the following function, which is an IIFE  test.init();  is working.

  1. var test = (function(){
  2.   
  3.   console.log("variable inside test");
  4.   
  5.   // This is a function inside another function (closure)
  6.   var init = function(){
  7.     console.log("variable inside init");
  8.   }
  9.   
  10.   return{
  11.     init:init
  12.   }
  13.   
  14. })();

  15. test.init(); // working
    test().init(); // not working - WHY?

Why  test.init();  is not working in the first example but is working in the second example??

Thanks