The 2 is a glottal stop (the stop in uh-oh) and the 7 is a voiceless pharyngeal fricative (like an H but breathier). The numbers are based on the shapes of the corresponding Arabic letters, ء and ح respectively in this case.
More information: https://en.wikipedia.org/wiki/Arabic_chat_alphabet
Basically this system originated when ASCII-only technology came to the Arab World, and without a way of using the Arabic script, Arabic speakers had to improvise. It remains popular to this day because… Well, I'm not an Arab, so I really couldn't say, but one Lebanese diasporan I used to know told me he was only literate in the chat alphabet and could not write in the Arabic script itself, which I found very striking. I'm sure there's a lot of dynamics of age or diaspora status at play here.