Why do planes dump fuel?

A pilot will choose to dump fuel only on very rare occasions. In the case of an emergency situation they can choose to dump, dirty up the plane or land heavy. Each has its pros and cons but here's why it's done in the first place.