As another commenter noted, not every aircraft advertises itself using ADS-B, but the majority do - even military. I’m no expert here, but I think the distinction is that military aircraft operating outside of civilian airspace don’t need to. But some do anyway - I’ve seen a U-2 flying at 62k feet over the Southwestern US show up on ADS-B exchange. There’s no need for it to do so, as no civilian aircraft flies at altitudes that high.
As another commenter noted, not every aircraft advertises itself using ADS-B, but the majority do - even military. I’m no expert here, but I think the distinction is that military aircraft operating outside of civilian airspace don’t need to. But some do anyway - I’ve seen a U-2 flying at 62k feet over the Southwestern US show up on ADS-B exchange. There’s no need for it to do so, as no civilian aircraft flies at altitudes that high.