A non-daemon thread (user thread) keeps running. If there are any non-daemon threads, the JVM keeps running too, until the last non-daemon thread "dies" (or finishes).
A daemon thread does not keep on running if all the non-daemon threads finish. So if you only have daemon threads still running, then the JVM will not keep running, and the daemon threads stop.
More poetically, from C Horstmann, G Cornell, Core Java 2 7/e vol II Advanced Features, Santa Clara: Sun Microsystems Press (Prentice-Hall) (2005) page 19:-
You can turn a thread into a daemon thread by calling
There is nothing demonic about such a thread. A daemon is simply a thread that has no other role in life than to serve others. Examples are timer threads that send regular "timer ticks" to other threads. When only daemon threads remain, the virtual machine exits. There is no point in keeping the program running if all remaining threads are daemons.