Some tags have highlighting turned on by default. These are mostly programming-related tags, like python, ampl, and modeling. In this case, the interpreter will try to infer the language, but if it gets it wrong, you can always specify it. If you want syntax highlighting turned on by default for a certain tag, let a mod know. And even if the tag doesn't have highlighting turned on, you can turn it on in your post by specifying the language in your code fence.
Highlighting is not currently available for AMPL, GAMS, and some of our other favorite OR-specific languages. If you'd like to take a crack at writing a highlighter for one of these languages that is compatible with Google Prettify, have at it—the SE developer who handles this feature said they would try to hook it into the system ("no promises, I've never done it, but it should be easy enough").
For existing posts, highlighting won't be visible until the post is edited.