In our first case, we have a single variable in position 2. This is because of a combination of tag syntax and usage. Therefore, name is evaluated as a basic part of the function before the IIF statement even kicks in. Now the IIF function says that it will evaluate whatever's in positions 2 and 3. In the second example, we escape this by placing name inside quotes.
Double quotes are for tag attributes only.
This avoids the first evaluation, due to standard function syntax. The second evaluation still takes place, as this is part of the purpose of the function. Our third example has the same result as the second arrives at it by a different means. But its contents are a variable, which any function will evaluate. In that one, the DE function contains NO variables, only text.