I understand that map::emplace_hint is used to place a key,value pair at a specified place in the map but in the end the map gets sorted so what is the point of placing it in a
I understand that map::emplace_hint is used to place a key,value pair at a specified place in the map
No, it isn't.
As you say, you cannot control the position of elements yourself. The map decides that.
This hint is to tell the compiler where you think the map will decide to put it, so that the map doesn't have to spend quite as long figuring that out for itself.
For example, if you already know (because it's your program!) that some new element is definitely going to end up at the "start" of the map, then you can pass this knowledge onto the container. It then only needs to check that you're right, instead of scanning through the whole tree to eventually come to that conclusion itself.
If your hint is wrong, that doesn't change anything about where the element ends up, but you're giving the map more work to do.