Is backup of IMAP necessary when switching to a new Macbook
IMAP and Exchange both keep your email on the server.   Adding the account on a new computer will allow you to access your existing email on a new local machine.

While you didn't mention POP3 in your question, that would be the email protocol that was designed to store your messages locally.  IMAP and Exchange protocols came later.