They're standardised zeroconnf protocols. Apple was part of the early development.
Bonjour is the apple implementation for mDNS.
Avahi is the GPL compliant implementation.
mDNS, llmnr (ms developed), have been known for ages to be vulnerable.
https://en.m.wikipedia.org/wiki/Zero-configuration_networking#Standardization
*I don't like apple
For reference, see New Apostolic Reformation and Seven Mountains
Shit is beyond crazy and terrifying.
https://en.m.wikipedia.org/wiki/New_Apostolic_Reformation
https://narconnections.com/
https://en.m.wikipedia.org/wiki/Seven_Mountain_Mandate