The reason is that you have set the settings of When Lid Is Closed to Suspend in Ubuntu
Lets understand what Suspend means and what Hibernate means-
Suspend means to save the state of your machine to the RAM of your computer.
In this case,RAM is volatile memory which requires power to function.And thus it uses battery.
When you resume from Suspend,it is quocker than resuming from Hibernate
Hibernate means to save the state of your machine to the HARD DISK/HDD/SDD of your computer.Now,anything saved in HDD/SDD does not need power to stay there.Thus no power is needed.
Resuming from Hibernate* is slower than resuming from Suspend
So if you want your PC to act same as it does in windows when the lid is closed,
1.Go to System Settings
3.In the When Lid Is Closed menu,select Hibernate