MP4 is the world's default video: the file that plays before anyone has to think about it. It was born in 2001, the MPEG standards group, built on Apple's QuickTime design, and its real weak spot is very little day to day: as a container its quality depends on the codec inside.
WEBM is video the way browsers like it: open, royalty-free and built to stream. A Matroska-based container restricted to VP8/VP9/AV1 video with Vorbis or Opus audio. That makes it the right destination when what you need is embedding on the web without licensing worries.