This post is a sequel of: [When should a supervisor be a co-author?][1]
Here, it's no longer about the interaction student-supervisor (as above), but about the interaction between two professional mathematicians (in particular junior-senior, but not necessarily).
Of course, this will depend on the nature of the interaction (Q&A on a specific subject or talks or informal discussions), its frequency (1 time/year or /month or /week or /day) and also on the level of the mathematicians: what can look a high contribution for one, can look not so high for an other. Also, someone don't need or just don't want to be a co-author, because it's not enough high level for him.
I've also heard about senior mathematicians of high level, allowing several discussions on a specific joint work with a lot of contributors, and then becomes co-author, just by writing a nice introduction, but without having written any detailed proof: like a conductor and his musicians.
Anyway, the mathematicians interact during conferences, by emails, on mathoverflow or in their institute.
How distinguish between interactions which should lead to a collaboration or to an acknowledgment?
[1]: When should a supervisor be a co-author?