Even those that require you give a certain amount of "notice" before you quit your current job (two_week notice is standard) often may not provide any formal requirement that you do so by writing a letter of resignation or explain in detail why you're leaving.
A resignation letter can also help your boss and your company start the transition process, get a replacement for you approved, and start planning internally, etc. The paper trail is beneficial all around. So what should go into your letter? Let's look at some examples of what to do (and perhaps more importantly, what not to do).