I suspect this won't get many upvotes, but only because not very many people know why this happens by accident frequently
There's a little button on the end of the Panel Titles that cycles through minimizing the Panels, then showing only the Tabs, then completely minimizing the Ribbon.
I recently found out that you can trigger that behavior by double-clicking to the right of that button as well.
In my Revit Beginners class, people get really confused when they double-click by accident and lose their Ribbon icons. I'm surprised at how often that happens.

While I can understand being able to chose how to show the Ribbon makes sense, I can't image that anyone changes it all that often.
That behavior should be set by an option in the Options dialog, NOT by (accidentally) double-clicking on the Tab area.