It is essentially a file where you can put rules and values to modify that of PHP variables. Many providers these days do not allow modifying php.ini file, instead, you have .htaccess to modify the variables for php.ini.
Essentially, it allows you to take directives that would normally be put in Apache's main configuration files, and put them in a directory-specific configuration file instead. They're mostly used in cases where you don't have access to the main configuration files (e.g. a shared host). But as MWEB mentioned you can use it for few other things too ... Thanks.