What is the Purpose of agar in media?

Agar solidifies media, and will remain solid even when placed in an incubator. Few microorganisms are able to metabolize it, so it won't provide an energy source.