AVI is the veteran of desktop video: dependable in 1995, cranky about everything invented since. It was born in 1992, Microsoft, and its real weak spot is modern life: no proper streaming, no subtitles, no love for modern codecs.
MP4 is the world's default video: the file that plays before anyone has to think about it. A container, most often carrying H.264 or H.265 video with AAC audio. That makes it the right destination when what you need is playing everywhere: browsers, phones, TVs, editors, slide decks.