Yammer = open by default, large groups of people, response time from others several hours, most people will just read. So broadcast comms, questions to large groups of people.
Teams = smaller groups of people who tend to collaborate on a specific topic or subject. Closed groups, limited to 600 users. Expect response in a few minutes. Most people will contribute. It’s a group based persistent chat tool.
Part of the challenge is that people have historically used Yammer groups for what Teams does now. It’s a cultural/behaviour change if people are using Yammer fir chat in small groups. Teams is much, much slicker and better for that.
(Disclaimer. I work for Microsoft and advise big companies on anything Microsoft at a high level. I can quite happily run a Teams demo/discussion including how it fits with Yammer, Skype for Business, email, Groups)