If you read the Gospels, Jesus often debated with people. Much of this was impromptu, on the spot discussions that sprang up. Someone would ask a question and they’d be off. The Jews often engaged in such discussions. It was one of their main forms of teaching. Mattthew 22:34-46 records one such off-the-cuff debate. If you look earlier in Matthew chapter 22, the Pharisees had tried to trap Jesus with a trick question earlier, but it didn’t work. Then the Sadducees, a different group of Jewish leaders, had tried the same thing with a different question, but they too had failed. Now the Pharisees were happy that the Sadducees got shot down, so they’re feeling pretty good.
If you read the Gospels closely you’ll notice that Jesus’ relationship with the Pharisees was not always automatically all-out war, although their judgmental attitude was often percolating along just under the surface. It didn’t take much to bring out their opposition to Jesus, even though they sometimes talked civilly with Him and He ate at their houses. Remember that the Pharisees were hypocrites. Even when they weren’t attacking Jesus directly, as here, their hearts were often essentially unchanged. Jesus did denounce the Pharisees for their hypocrisy often, but He did not refuse to talk to them at all or to be around them. Maybe that makes their eventual betrayal of Him to death by the Romans even worse.