MKV is the format that hoards: video, a dozen audio tracks and every subtitle, all in one box. It was born in 2002, the open-source Matroska project, and its real weak spot is playing on TVs, iPhones and editors that never learned to open the box.
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.