I am going to be talking Drupal here pretty much, but the same logic applies to any development.
So there's certain block or data on a page you want. You've developed a query that needs a lot of joins and resorts to all kinds of nastiness in MySQL (temporary tables, filesorts, large number of row returns, etc). One of the common cures it to cache the results of that query. This can be a life saver, but care should be taken to do it right.
Let's take a look at a common way of handling this: