How the frames actually get out of your video
A browser will not simply hand over "frame 147" of an MP4. What it will do is seek a video element to a timestamp and let you copy the displayed picture. That is the path used here: seek, wait for the seek to settle, capture, repeat.
It is not the fastest approach available — WebCodecs is — but WebCodecs also requires unpacking the container yourself, and support for the codecs inside varies by browser and platform. Seeking works everywhere, which matters more than raw speed when the alternative is a conversion that fails outright.