How to avoid lags when listening to music on a Mac?
Check out nice and renice which work on the command line.

You can change the priority level of processes, but to change other users processes you have to be admin level...

Just to provide a link with examples, see https://www.lifewire.com/uses-of-commands-nice-renice-2201087