When it comes to image compression algorithms, there isn’t one simple way of saying that one format is definitely bigger than another. To speak in generalisations though, I would say that what you heard is the other way around: by and large JPG tends to be smaller than PNG.
But, that’s a pretty vague statement, and mainly only true when we’re talking low to mid-high compression settings in the JPG. An “archival” JPG with minimal compression can sometimes be larger than a PNG of the same image. PNG-24bit files can include a fourth channel, one that is a greyscale alpha mask, which increase the base uncompressed size over the JPG’s maximum of three channels (basically a 3-channel image has three images in it, one for red, green and blue). The amount of detail in the image itself can impact compression efficiency, such as a photograph of a forest being far more difficult to compress than a graphic novel panel comprised of large flat regions of colour. And then you’ve got PNG-8bit, which is much more like GIF in that it has a colour index of anywhere from two to 256 colours, and those colours are allocated in vector fields to redraw the image. For the aforementioned graphic novel, PNG-8bit would be very efficient and result in images far smaller than either JPG (which would have to use relatively low compression settings to avoid visual grunge around hard lines) or PNG-24. PNG-8 is also great for screenshots for similar reasons: large fields of flat colour, with a little anti-aliasing for the text, which can in monochrome be fully expressed with 16 shades of grey, but not if the screenshot has some form of sub-pixel rendering baked into it, which then uses a variety of colours to trick the physical display into using fractions of a pixel to draw letter angles, and is thus more expensive to compress than 16-grey aliasing. Almost all of the screenshots I upload to the forum are PNG-8bit, because I can say with 5kb what other people are saying with ten or even twenty times that in JPG/PNG-24. On the other hand, PNG-8 is horrible for complex images that lack large flat fields, like a photograph of a forest, and will probably be larger than either PNG-24 or JPG-archival, and look way worse to boot. Now as for PNG-24, the reason why it tends to be larger than JPG is because its compression algorithm is reactive only to the same kinds of repetitions in content that ZIP compression can exploit, and it is similarly lossless (which is very important!). You can save the same PNG file over and over and it will never degrade, while JPG will very quickly turn to useless mush—look at your average “meme” for evidence of that. PNG isn’t so much “looking” at the picture and deleting detail out that the human eye won’t see, like JPG does. There are even some general-purpose compression algorithms out there, like 7zip, that are better at compressing images than PNG is (though your browser won’t show them as images, so there is that).
And then on top of all of that you’ve got metadata, which can bloat file size quite a lot! Using tools that save clean “pixel only” images (or “web ready” as it is often called) can, over a large quantity of images, save you megabytes. Maybe not big deal in Scrivener usage terms, but that can mean the difference between one compensation tier or another in an ebook.
So yes… more complicated than A is better than B!
A lot of the times it will depend more on what the image is for, than how much space it takes. The losslessness of PNG can be critically important to some workflows, or even phases of the workflow. I use PNG-24 for all original screenshots in the user manual (where I am not using XCF for layered composites that get exported to PNG). Before creating the PDF however, I batch convert them all, stepping down on them rather hard to about 65-compression JPG, because if I didn’t do that the user manual PDF would almost be larger than Scrivener itself! I use PNG on the production side because I never lose a pixel from one edit to the next, but I use JPG for the PDF treatment to keep the installer size reasonable. If I really had the time to dedicate to it, I’d probably go through an hand optimise each screenshot in the manual to PNG-8, which would make the PDF a small fraction of its current size. But alas, I don’t have that time.