Hardened steel with a proprietary coating called tennifer that actually bonds with the metal to provide a microscopic layer of wear and rust resistence. Tennifer is not the black coating which I am not sure what they use for that. The slides can and do scratch, wear etc. They are, however hella tough all things considered.
I am guessing you are not really trying to scratch the frame in a defacing way and just doing a light scratch to see if it will show up like on a blued gun. Like I said the glock finish is tough but will indeed scratch or wear.
My other theory is that all the ugly is able to repel most attacks but I haven't proven this as of yet.