Presumably, the disciples were with Jesus when the Pharisees came to him asking for a sign from heaven. They would thus have heard the exchange between them. Jesus now, on the boat journey across the lake hears the disciples speaking about bread. He then uses this opportunity to warn the disciples about the Pharisees and the Herodians.
15 And he cautioned them, saying, “Watch out; beware of the leaven of the Pharisees and the leaven of Herod.”