the browser supports releative urls, that is if the path does not contain the protocol, it uses the page protocol, if it does not contain the domain name it uses the current page domain. it also supports the ".." path operator. if the relative path start with / then only the protocol, domain and port are defaulted.
in your case the default path is:
as this is a relative path, the browser appends it to the default path. if you used
the browser would have produced:
the mvc tag helpers modify url path strings that start with ~ to be a relative path which included the subsite path. as you used the attribute on a non-url attribute (data-src) it was not modified.