File size and screen recording
Conceptually, screen recording works by taking a screenshot of the screen many times per second.  Taking a screenshot works by taking a copy of what is displayed on the screen.  To understand how that works, you need to understand how things are displayed on the screen; for that, I recommend reading about framebuffers.  The screen capture might then be stored in a compressed or uncompressed format.  The file size will be influenced by the resolution of the screen, the length of the video, and what compression is used (if any).