To compare is to examine how things are similar, while to contrast is to see how they differ. A compare and contrast essay therefore looks at the similarities of two or more objects, and the differences. This essay type is common at university, where lecturers frequently test your understanding by asking you to compare and contrast two theories, two methods, two historical periods, two characters in a novel, etc. Sometimes the whole essay will compare and contrast, though sometimes the comparison or contrast may be only part of the essay. It is also possible, especially for short exam essays, that only the similarities or the differences, not both, will be discussed. See the examples below.
Compare and contrast Newton's ideas of gravity with those proposed by Einstein ['compare and contrast' essay]
Examine how the economies of Spain and China are similar ['compare' only essay]
Explain the differences between Achaemenid Empire and Parthian Empire ['contrast' only essay]