The first level cache is implicit in the Session. The second level cache is configurable declaratively and requires a third party implementation (such as EHCache).
Caching is important in any database backed application to prevent huge numbers of round trips to the database. This tends to be the bottle neck in database applications.
The
documentation covers this in more detail.