This function is applied to the filter 'wp_insert_post_data'. On subdirectory multisite installs, it filters Pages' 'post_name' (URL slug) field to ensure that there is no conflict with any of the subdirectory links.
If you have a one of your sites set up on a sub-directory 'my-site', and then publish a page on your main site titled "My Site", the slug would by default be 'my-site'. So the URL of the site on your network would be http://www.example.com/my-site/, but that would also be the URL of that page. The avoid_blog_page_permalink_collision() function fixes this conflict by appending a random string to the page's slug.
avoid_blog_page_permalink_collision() is located in