Difficulty with usb_vcp

I am using Arduino Nicla Vision.
I am trying to use the usb_vcp module. Many of the examples of code that I found on this forum contained the following lines of code to read the compressed image sent by Board

        size = struct.unpack('<L', self.port.read(4))[0]
        print("size of the image:", size)
        image_data = self.port.read(size)

Is there a specific reason we only read 4 bytes to know the size of the data we are sending?
Also, why do we try to access just the first element of the same (aka just accessing the 0th index)?

The size is sent in 4 bytes so it reads 4 bytes, you could send it in 2 or whatever fits. The [0] because struct.unpack returns a tuple, first element is the unpacked value.