It’s because you have to put it in <Directory> directive.’ .htaccess is per directory context, so you have to explicitly tell apache where .htaccess is allowed to be used.
<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Options Includes
<Directory "/var/www/html">
AllowOverride All
</Directory>
</VirtualHost>