I need to implement url shortening functionality in two ways. First, I don’t want to show site structure (/content/site/en/..) in browser url. Secondly, <a href> url on component should show only short url instead of complete page hierarchy (not starting with /content). I have seen multiple forums, but got confused between which one to use when? Can somebody please explain the use of these?
Sling Mappings – under etc/map
Apache Sling Resource Resolver Factory – I do see (Url Mapping and Mapping location properties there) - why are both configured?
Resource Resolver Factory is the solution for your case; just configure url mapping like  it will hide the configured content hierarchy in both the cases, url and anchor tags. Check the url mapping description in configuration for more details