<Directory> (except for regular expressions) and .htaccess are processed simultaneously, with the directives in .htaccess overriding <Directory>.
<DirectoryMatch> and <Directory ~ > with regular expressions are processed next.
<Files> and <FilesMatch> are processed simultaneously.
<Location> and <LocationMatch> are processed simultaneously.
Apart from <Directory>, each group is processed in the order in which it appears in the configuration files. <Directory>s (group 1 above) are processed in order from the shortest directory component to the longest (e.g., first / and only then /home/www). If multiple <Directory>sections apply to the same directory, they are processed in the configuration file order.
Sections inside <VirtualHost>sections are applied as if you were running several independent servers. The directives inside one <VirtualHost>section do not interact with directives in other <VirtualHost>sections. They are applied only after processing any sections outside the virtual host definition. This allows virtual host configurations to override the main server configuration.
If there is a conflict, sections found later in the configuration file override those that come earlier.