The arrangement of words and phrases, as well as the principles that govern how sentences should be constructed, is referred to as syntax.
Therefore, syntax can be classified as part of the grammar category; but, it is not the same thing.