If you're still "active" on the computer it notifies you there and doesn't think it needs to also reach you on mobile. But I think you can set your mobile notifications to notify anyway.
Discord is nice with this and if your desktop goes idle without you reading messages it then pushes them to your phone. It’s one of the best features I haven’t seen in many other products. Particularly as it mutes your mobile notifications when you are on desktop. Which a lot of products also get wrong.