It doesn't, because it can't.
The process of editing an attachment is: download a copy, edit it locally, upload the new version. The server cannot know what is being done to a copy of the file it holds.
There are some add-ons which put a form of lock on attachments so that people can tell someone else is editing and has the intention of uploading a new copy, but there's no way to know what is happening on other machines.
Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs