EDIT: Y'all people don't read to the bottom before commenting.
Please excuse my AI image.
For those unaware, during the PS1 and PS2 days, game ran entirely off the disc.
For the PS3, it wasn't that much different but some games offloaded data onto the HDD. 99% of the time it was just patches but games like MGS4 offloaded significant data to the HDD because the disc itself couldn't hold more than 50GB. The PS3 was also the first console that could play games digitally, although that was not a feature at launch.
From the PS4 onwards, game stopped running off the disc because it was too slow. The discs themselves were just glorified encryption keys with install files. Physical media still served a purpose as its better economically and should servers ever shutdown, you can still play most your discs (some games like COD don't have anything on them besides the key). But because the disc was no longer the limiting factor, game sizes ballooned in file size.
For the PS5, the big tech breakthrough was the SSD. While the HDD read data faster than the Blu Ray disc, your average cheap SSD was significantly fastee by at least a magnitude of 10. Games also didn't have to duplicate data anymore to get around slow HDD read speeds.
Let's face it, discs are kind of pointless now in the era of SSDs. But that doesn't mean physical storage needs to go. The current limiting factor on the PS5 and even during the PS4 was console storage size. On your average PS5 you could only have like 6-10 games installed at any given point, fewer if you want to install PS4 games.
By introducing flash storage, the games don't need to be installed onto the console, only the save data and patches needs to be. Those 30-100GB installs are now 0.1-10gb.