Does stack mean a pile? If so, is it used as a metaphor for exchanging information? If, again, so then what is it about a pile that makes it, but not a box, a metaphor for information exchange?
The original site on the "Stack Exchange" network was "Stack Overflow", a site dedicated to answering technical questions. The name is a humorous reference to a computer condition called a "stack buffer overflow" where a process writes outside of its allocated memory and potentially causes the process to crash.
In this context, "stack" refers to the section of computer memory allocated for a particular computer process, and is (somewhat) different from the more common use of "stack" to refer to an organized pile of objects.
As a noun, an "exchange" is a place where goods or ideas are transferred or sold. A good example is the New York Stock Exchange, where, every day, millions (or perhaps billions) of shares in publicly traded companies are bought and sold.
The combined phrase "stack exchange" has no real meaning. Instead it's a concatenation of "Stack Overflow" and a reference to the exchange of questions and answers on a wide variety of subjects.