As you probably understand by now, file size is not a good indicator of image quality, and it will vary depending on the file format, and the compression settings used. The only important numbers are the pixel dimensions. (but you will of course need to use a high quality setting when saving a jpg to get good image quality)
The image below was taken with a 24 megapixel camera, and the pixel dimensions are 6000 x 4000.
The original raw file (14-bit NEF) was around 32 MB, converting it to DNG, which uses lossless compression, reduced the file size to 26.7 MB. Raw files are relatively small because they are one channel grayscale files. (the colors are added in the rendering process)
Saved as an 8-bit uncompressed tiff, the file size will be 68.7 MB, as 16-bit 137.3 MB. (The tiff format also offers optional lossless compression.)
Saved as jpg at max quality, the size is 17.8 MB.
As demonstrated by D Fosse the file size of a jpg will vary greatly depending on image content.
Flat or smooth areas will compress well, whereas sharp, busy detail (including noise) will not compress well.
The image below has lots of sharp detail, so the file size is relatively large.
![]()