When you do something that requires WordPress write to the filesystem, it does a check to see if it has permissions to do so by writing a temp file. If this check fails it will ask for FTP details in order to write the files to your server.
EDIT
look in wp-admin/includes/file.php, line 843, for the get_filesystem_method function that does this check.
At line 853:
if ( getmyuid() == @fileowner($temp_file_name) )
The use of getmyuid() is wrong for unix - instead that should be posix_getuid(). The problem is the getmyuid() will return the owner of the script file not the user that is running the script. On unix, that means if the file was installed by root and the webserver is running as user www-data then test will fail even thought the file is written during the test.
So to fix, change the line with getmyuid() to:
if ( posix_getuid() == @fileowner($temp_file_name) )
OR
add this in wp-config.php ( recommended )
define('FS_METHOD', 'direct');