No, it's not necessary to provide a detailed reason for your resignation in the letter. However, you can briefly mention that you've accepted another position, are pursuing a career change, or have personal reasons for leaving.