First of all, my approach of
find ~/Desktop/folder -prune
is better than yours, as my putting the full path in the first argument means find will return an error if the file does not exist.
Your approach has 'find' always returning success.
As for your 2 different find's
In the first, you NEVER process the -prune UNLESS -name folder is TRUE. That is to say your find command looks like:
find ~/Desktop -name folder -a -prune
where -a is AND and only gets invoked if -name folder is true, so you have not invoked -prune until you find a -name folder. The -a is implied between arguments.
In the second, -prune happens first, and stops looking inside of ~/Desktop, so -name folder will never find anything.
After the path argument, every -xxxx argument is assumed to have a -a (AND) between them, unless you specify something like -o. This is why man find constantly says things always return TRUE, because it is important to move on to the next -xxxx aargument.