It's a shorter url for local links, but it's also the actual location of the source of the content.
So for this thread, copy url for me is https://fedia.io/m/[email protected]/t/134107/What-does-Copy-URL-to-Fediverse-do
however, copy url to fediverse is https://kbin.social/m/kbinMeta/t/240118
The latter is the url that can be used to load the content on other fediverse platforms. For instance, if I take that url and plug it into the search, it will display the thread: https://fedia.io/search?q=https%3A%2F%2Fkbin.social%2Fm%2FkbinMeta%2Ft%2F240118 (edit: this might be a bit iffy. it showed the top thread post before but now it shows a comment inside the thread. I think it's a bit wonky at the moment some times)
I think a shorter answer is: the first url is the location on your instance, the second url is the location of the original content
This is true for profiles, comments, and threads. For instance, I see a lemmy.ca
user commented on this thread. Their comment's url to fediverse is actually https://lemmy.ca/comment/1519825
because they are posting on their instance's copy of this thread, so the source of the post is a different server
Edit: This is a little mastodon specific but goes over the concept, especially the last two sections https://fedi.tips/what-are-original-pages-in-mastodon/