This is a question that is often asked here, but I do not see a clear, comprehensive response. Since I have worked for multiple of each, I feel qualified to lay out the important differences. Let me note up front that Feds are definitely research departments, as are universities. You will as part of your job research, write, and publish papers. Now let's get to the differences, in order of importance:
1. Colleagues: Feds hire macroeconomists and friends. On the one hand, this is broader than some people expect: it's not just business cycles and money. On the other hand, most people do research with aggregate or at least regional implications. These are your colleagues, and also the talks you are exposed to.
2. Side job: policy vs. teaching. At universities you teach to pay the bills. At Feds you do policy work. The quantity and also the quality of policy work varies, just like for teaching. At bad Feds you do frequent, unpredictable, annoying policy work; at good Feds you do infrequent, predictable policy work related to your research.
3. Flexibility. Feds are less flexible. They are structured as 9-5, Monday-Friday jobs. It's not as bad as that; the vacation allowance is good, there are bank holidays, and generally nobody really tracks if you show up day to day or when you show up. But disappearing for a week or, God forbid, the summer, or only showing up for "teaching days", is much harder to impossible.
4. Pay. Feds pay better. Conditional on "rank", about 20% better. This is in part compensation for having to work summers.
5. Shocks. Shocks at universities are frequent but generally short-lived. The department's quality mean reverts quickly, and even if your Dean stinks they disappear quickly. Shocks at Feds are infrequent but nearly permanent. A new President or Research Director can make the place much better or worse for a decade.
6. Terminal condition. Most people understand that research universities lead to tenure. You may or may not understand that this eventually leads to a change in job: advising, editing, tenure letters, more committee work, etc. Feds also have a similar transition, which is the pull to administrative and policy work, especially high-level FOMC involvement.
7. Visitors, talks, and exposure. Feds have more frequent talks in macro areas. They also have more visitors, because they have good ties to universities and pay visitors well.
Most other aspects I can think of seem pretty similar. So those are the tradeoffs.
Finally, there is a strong ranking among the Feds. I don't want to get into which is best, there are plenty elsewhere, but it's not useful to ask whether "Feds" are above rank X. However, one thing worth noting is that the ranking of NY and BOG vary widely. This is fair because these Feds (unlike the others) have large within-institution variance in quality, mostly in terms of colleagues and quantity/quality of policy work.