The short answer is that optimizing is really just taking out dead space. When MySQL writes out data that data takes space, of course. When the data is deleted, say removing posts for example, MySQL does not use that space again. It doesn't shrink it's table size. So you end up with a larger and more fragmented table which can slow youy down if you're already running your database right to the edge. Optimizing it removes the empty space.
What it actually does is rewrites the table out into a temporaty location, from scratch, which removes the dead space, then moves it back to where your table originally existed.