It is trained to practice chemistry and law. The reason it can do those because it's trained on an appreciable portion of all human output on both or those fields. If that's not training on them I don't know what is.
This sounds backwards to me. The fact that I can show you a law book and you will be able to pass a law exam is a consequence of you being "generally intelligent". If I show these books to something less intelligent like a cow, or less general, like a CNN, they won't be able to do that.