You click update on a plugin and WordPress asks for FTP credentials you’ve never had. It does that when the files it creates would have a different owner from its own files.
WordPress tests this by writing a temporary file. If the owners differ, it falls back to FTP or SSH. First check ownership, since that is usually the real fault:
ls -ld wp-content wp-content/plugins index.php
When the web server user is meant to manage these files and the permissions are sane, you can tell WordPress which method to use. Add this above the line that says to stop editing:
define( 'FS_METHOD', 'direct' );
Updates and installs now write straight to the filesystem. The other accepted values are ssh2, ftpext and ftpsockets.
I wouldn’t use it to paper over a mess. The constant skips the ownership check; it grants no permissions. If the web user can’t write, updates now fail with a copy error in place of the prompt. And if it can write only because everything is set to 777, you have a bigger problem than a popup.
Think about shared servers as well. With direct writing, new files belong to whatever user PHP runs as, which on a badly separated host could be the same user for several sites. On your own server or container with one site per user, that is generally fine.
Further reading: WordPress developer docs: wp-config.php