Doubt in code implentation

why we did mp[q.front()-‘a’] for the frequency

because mp is a map and q.front() gives us a character between ‘a’ and ‘z’ so to find out the location of this character in the map we do it this way because it gives us the index corresponding to that character where we can access its frequency.