I faced this the first time, when I started working in a company where most of the employees went together to lunch. Leaving the office, wishing those who stood in the office
Mahlzeit!
or those staying in office saying same to those leaving. So it felt like some sort of announcing to leave now. Or something similar to wishing to enjoy their meal. I just started adopting it at one point, as since then I faced it at almost any company I had been working yet.
After I was asked by a coworker who currently is learning German, what it means and why people are saying it, I was struggling to be able to explain how this might have come up.
So what is the origin of people going to have lunch telling others "Mahlzeit!"?
Because, even knowing its meaning The term "Mahlzeit" from that other question, I am still wondering how this would end up being used in such way.