As a sign of respect or as an indication of public mourning, flags are oftentimes lowered partway down their respective flagpoles. This was most recently the case following the tragedies in California and Texas, as well as during memorial observations like Remembrance Day and Veterans Day. When a flag is lowered in such a manner, it is said to be “flying at half-mast.”
The “mast” in “half-mast” is taken literally to mean the tall, upright post on a ship. It’s the “pole” where the sails are normally attached. As such, the term has a nautical origin, just like how you batten down the hatches in preparation for imminent danger or trouble.
Often used interchangeably with “flying at half-mast” is “flying at half-staff,” which effectively means the same thing. It’s when you lower the flag from its normal position at the top of the flagpole. Strictly speaking, though, you should be using “mast” when the flag is flown on a ship and “staff” when the flagpole is on land. Most people aren’t going to fault you either way.
Of course, the word “staff” in this case refers to the flagstaff, which is just another term for flagpole. It has nothing to do with the group of employees at a company or organization, at least not directly.
Another small curiosity worth mentioning is that while we assume the term should be taken literally — as in the flag should be lowered such that it is literally halfway down the pole — that isn’t always the case. Different protocols interpret the practice differently. Some say that the flag should be no lower than two-thirds of the way up the flagpole. Some say it should only be lowered the width of the flag.
While the specifics vary, the practice is very common and has been observed in just about every part of the world, from Canada to Iran to New Zealand.