When you have questions like this it's best to consult the man pages. Take a look at the
rpm man page.
$ man rpm
Prints macro expansion of EXPR.
%fedora is a macro if you go a bit further down in the
rpm man page you can see what files provide macro definitions.
Taking a peek inside of
/etc/rpm/macros will reveal this definition.
$ grep fedora /etc/rpm/macros*
So we can see that there is a definition called
%fedora and on my system (Fedora 19) it has a value of "19".
Inline command execution
$(..) will execute whatever command is between the parenthesis and substitute the returned results in their place.
$ echo $(echo hi)
Or in your case:
$ echo $(rpm -E %fedora)
Putting it all together
So when the command you're asking about runs the following things happen. A RPM macro,
%fedora is evaluated using the
rpm command. That command is executed in line. Once expanded to "19" that value is used within the larger
yum command to install the appropriate
.rpm file for a given version of Fedora.