Why do we screw doors into the doorframe rather than the studs?
Properly installed, at least some of the screws should go thru frame and into studs. The short screws are mostly there to keep everything aligned while a pre-hung door-and-frame set is assembled and shipped. Once it has been hung and shimmed properly, those screws can be replaced with better ones... but aren't always.