Question about do_shortcode

There are number of ways to do it.

The specific one for your case is that you have to find the function which that shortcode “calls”. For this, you can download your theme and plugin files and search add_shortcode or better product_categories(your shortcode name) term in all files using some notepad software. Notepad++ has a good feature for it that lets you to search term in all files in a specific directory. Once you find it, it should look like:

add_shortcode( 'product_categories', 'function_for_product_categories' );

Now you know that function_for_product_categories is the function that you want. Then you can search for function_for_product_categories to find the function which gives you that output and do the whatever change you want.

Another way is more generic, that you can use to find and explore the theme or plugins to do your custom edits. You can search html tags(class names, ids etc.) of output in all theme files to find the function. This way, mostly you will get more results and you will need to find which one is exactly what you want.

Note: Don’t forget, that if you do the change to directly theme and plugin files, if you update them, your changes will lost. So if you are going to update them, define new functions in child themes or in your own plugins and use them.

Resources that you may look:
https://codex.wordpress.org/Shortcode_API
https://codex.wordpress.org/Child_Themes
https://codex.wordpress.org/Writing_a_Plugin