Most hardening guides tell you to set DISALLOW_FILE_EDIT. There is a bigger switch next to it.
DISALLOW_FILE_EDIT removes the plugin and theme code editor from the admin. Good, because an attacker with a stolen admin login would otherwise get to write PHP straight from the dashboard. DISALLOW_FILE_MODS goes further. It also blocks installing and updating plugins and themes from the admin, and it includes the editor block, so you do not need both.
define( 'DISALLOW_FILE_MODS', true );
With that line a compromised admin account cannot upload a malicious plugin. Updates then happen outside WordPress: with WP-CLI, Composer or a deployment from Git. For a site that I manage myself over SSH, I think that is the better setup.
The caveat bites. The Updates screen stops working, so nothing updates itself from the dashboard any more. If nobody runs wp plugin update --all on a schedule, you swapped one risk for a worse one: old plugins. Only use this when you have a real update routine. If you do not, DISALLOW_FILE_EDIT alone is the safer choice.
Further reading: Editing wp-config.php (WordPress developer docs), On this site: wp config shuffle-salts logs everybody out after a break-in, On this site: set WP_ENVIRONMENT_TYPE so plugins know a site is staging