What is "academic freedom", when so many professors and post-docs do only the research that is being funded by external agencies? Do professors truly get to work on whatever they want, in research?

I just read a job description for a post-doc position; the job sounds extremely specialized, with no room to do anything else outside of that job requirement.  

And generally professors are funded by external agencies to do pretty specific research.

Is there really academic freedom for professors in the United States?
While it is certainly true that the bulk of university research depends on external funding, and thus requires approval of the external funder, there are a number of ways in which a professor in the United States (and many other nations) can pursue research with almost complete freedom:


Most professors own salaries are supported (at least at a "9 month" level) on the basis of teaching, not from research grants.  A research position, however, often teaches only 1-2 classes per semester, however, leaving significant time for the professor to spend on research, whether or not that research also has external support.
Some undergraduates are willing and able to work on research for course credit or even on a volunteer basis.
Graduate students and postdocs are sometimes supported on fellowships that put no constraint on the subject of their research.
Some institutions also allow professors to "bank" a portion of the research funds that they bring in, which may then be used later as unrestricted funds.
Early career professors often have startup funds and later career professors often have endowed chairs, both of which typically have no constraints on the research they can be used to conduct.
In extremely rare cases, a professor may get a "genius grant" or similar sort of external award that is a significant amount of unrestricted money.


The amount of resources available through such unrestricted routes is typically much smaller than if one can convince an external funder that one's work is worthy, but one can get quite a long way on preliminary work, proofs of concept, and small-scale experiments with rather small amounts of resources.

Combine this with the fact that there is a wide diversity of funders out there with different agendas and preferences, and one can see that academic freedom in research is very real indeed.