The shell does not split words to assign variables (standardized in this way with POSIX, and you can rely on it). This way you don't need double quotes (but you can use them without making the result different) in
variable=$(command)
However, before executing the commands, word splitting is performed, therefore, in
echo $(command) echo "$(command)"
The result may be different. The latter preserves all multidimensional sequences, while the former makes each word a different argument for echo. It is up to you to decide which one is needed.
An interesting quirk shell: there is another place where quoting a substitution or does not make any difference, namely the expression in the case expr in construct.
case $FOO in (frob) ...;; esac
indistinguishable from
case "$FOO" in (frob) ...;; esac
source share