Apt-get is not in non-interactive mode
When debian is in non-interactive mode, anytime a question pops up, it can cause a failure in the install scripts. This forces debian to be in non-interactive mode, resulting to using the default answer, and not causing a failure.
For more explanation see documentation for debconf. https://manpages.debian.org/testing/debconf-doc/debconf.7.en.html