These verses describe how the people in the crowds reacted to Jesus' teaching in the Sermon on the Mount. (See: [[rc://en/ta/man/translate/writing-endofstory]])
It is clear in 7:29 that they were amazed not just at what Jesus taught but also the way he taught it. Alternate translation: "were amazed by the way he taught"