Why did this work?

I recently purchased the following computer Acer Nitro 5 AN515-53-762Q

Which gave me a lot of trouble when trying to install Ubuntu 16.04

I tracked the issue down to the video card (GeForce® GTX 1050) which was causing freezing and infinite loops at the login screen. After many attempts I finally have the computer recognising and using the video card. The last thing I did was:

sudo apt-get remove purge nvidia-*
sudo ubuntu-drivers autoinstall

(up to this point it still would freeze/loop at login then I did)

sudo apt-get install gdm
sudo service lightdm stop
sudo dpkg-reconfigure lightdm (then in the menu I selected gdm3)
sudo reboot now

and it works!

So my question is, why did switching to gdm3 make it work? and what is gdm3/lightdm?

Thanks!

This site is for the co-ordination of the Ubuntu project(s), and not support.

For Ubuntu Support options, there are many listed at https://community.ubuntu.com/t/finding-help/712