In UNIX, everything is a file. All stdout is by default is the (for example) /dev/tty file which is a device driver hooked up to your console/terminal/window. Output is just sent to that file (device driver) which causes it to be output to whatever you're using for interactive I/O.
All the a command like a.out >xyzzy.txt does is first connect the standard output of the program to that file rather than /dev/tty, hence the output shows up there instead.