By default stdin, stdout, and stderr are file descriptors opened during process creation.
If the file limit is 16, for example, then the process has 13 files descriptors to play with.
In shell scripts, redirection uses up file descriptors. Once the line "doing" the redirection has been completed the file descriptor is closed ie: ls * > myfile.txt. Redirecting blocks of code, like a loop, use up a file descriptor over many lines of code.
Code:
for file in `ls /path`
do
cat $file
done > myfiles.txt