According to one popular theory, a laptop is sufficiently dense that it presents as a solid block on the screen of an X-ray scanner, and therefore it could be used to hide something inside. If that were true it would present as a solid object whether inside or outside a carry-on case.
In fact whether inside or outside a typical carry-on bag, a laptop presents clearly on the screen of the X-ray machine as a semi-transparent object with battery, hard drive, CD player, speakers and other components visible and easily identified. So if that's the case, why is it even necessary to take it out of your carry-on bag?
The reason is that while the X-ray image shows what's inside, there are some parts of a laptop that are difficult for the X-ray to see beyond, and in particular the battery. As well as dense, a battery can be a fairly large object.
If the laptop were to remain in a bag it might be possible to conceal contraband, whether a weapon, an explosive device or drugs below the battery and have it pass through the scanner undetected.
While it's a low-risk scenario, those tedious but stringent security checks have kept us safe from terror attacks in the skies for many years now. It would be unwise for any administration to relax those checks.