Assume if I want to change the value of
php_value post_max_size 20M in .htaccess
post_max_size 20M in php.ini
Both will do same operation. So
The configuration in the php.ini is used for the whole server while the configuration in a .htaccess file is only used when a request goes to the directory or subdirectory the .htaccess file is located in.
So you can have a global or default configuration in your php.ini and specific configurations for individual directories in .htaccess files. Furthermore web hosting provider often do not allow access to the php.ini or server configuration but do only allow .htaccess files.
But notice the configuration modes every PHP configuration is bound to.