The Herodians were the political religious class of the day in the time of Jesus. Their name comes from their support of King Herod Antipas, the Jewish ruler appointed by Rome who ruled from 4. BC to AD 39. The Herodians as a political group was in the pocket of the Roman government.
The Pharisees were an unofficial group of leaders whose goal was to purify the Jewish nation through an intensified observance of the Jewish Law or Torah. The Torah consisted of the first five books of what we call the Old Testament Pentateuch, i.e., Genesis, Exodus, Leviticus, Numbers, and Deuteronomy. In addition, the Law can refer to the whole Jewish legal tradition written and oral. Following the Torah was not a means of gaining favor with God but was seen as a way of expressing thanks to God for his rescue.
For the Pharisees, the Herodians allegiance to Rome compromised Jewish independence. This deference to the Romans made it difficult for the Herodians and Pharisees to agree on anything, except their opposition to Jesus which both parties saw as a threat to their own political and religious agenda.