When you use -i with sudo, the user's login shell, $SHELL, will be used, and will be invoked as a login shell.
When you additionally give the command a command to run, as in
sudo -u user -i 'some-command'
... sudo will run that command with $SHELL -c, meaning it needs to convert the list of arguments it gets itself into a single command line string that gets evaluated by the shell again. For this to work, it has to escape each character in some-command, except for alphanumerics, underscores, hyphens, and dollar signs.
This means that
sudo -u user -i bash -c 'a="b" ; echo ${a}'
will be executed as the user user, escaped as the equivalent of
$SHELL -c bash\ -c\ \'a\=\"b\"\ \;\ echo\ $\{a\}\'
... while using $a turns the command into
$SHELL -c bash\ -c\ \'a\=\"b\"\ \;\ echo\ $a\'
Note that in this last command, $a is expanded by the user's login shell before it can start bash -c. In the previous command, where ${a} is used, the $\{a\} is not a valid expansion, so the user's shell makes no expansion, and the inline bash -c shell sees ${a} and can expand it.
This extra quoting that happens is explained in the sudo manual, in the section describing the -i option:
-i, --login
Run the shell specified by the target user's password
database entry as a login shell. This means that login-
specific resource files such as .profile, .bash_profile, or
.login will be read by the shell. If a command is specified,
it is passed to the shell as a simple command using the -c
option. The command and any arguments are concatenated,
separated by spaces, after escaping each character (including
white space) with a backslash (‘\’) except for alphanumerics,
underscores, hyphens, and dollar signs. If no command is
specified, an interactive shell is executed. [...]
$avs${a}, which is indeed quite surprising and not easy to figure out based on the answers of the dupe target. Since we now have a clear, specific answer for this particular case here, I think it might be better to leave it open.$not quoted and the interactions it causes are kinda surprising, and I'm not exactly sure I agree with the guy who had marked that "Why do I need curly braces..." as a duplicate of the earlier one. Oh well, guess we'd better change the duplicate list to point to this one too, then.