What does repair and optimize tables in PHP MyAdmin actually do?
Someone told me Optimize is...

Do you remember when we used to defrag HDDs? Table optimization is something similar to that. It restructures a table so that data pages are next to each other and releases unused pages. If you ever delete a large part of the table data, optimization shrinks the table file down to the proper size.