What software are you using? I know for a fact that QuickTime Player's screen capture feature doesn't include desktop audio. And I know for a fact that Logic, GarageBand, Audacity, etc. don't either. OBS does capture computer audio though.
The only reason I would think the desktop audio would be picked up is if you have an audio interface and you set up a loopback channel.