We are not told explicitly who the crowds were. Presumably, just like with John the Baptist, they were people coming from Judea and Jerusalem. Jesus made teaching one of his priorities during his time on earth (Mark 1:38) and so we should not be surprised to read that it was his custom to teach people.
1 And he left there and went to the region of Judea and beyond the Jordan, and crowds gathered to him again. And again, as was his custom, he taught them.