Until Mojave, if you quit an app that did not have “Keep in Dock” enabled, it disappeared from the dock immediately. Mojave changed that. Now it sticks around for a while. That’s irksome; I thought it was a bug until I realized it was a new Mojave feature. You can undo this feature by going into System Preferences -> Dock and disabling the checkbox labeled, “Show recent applications in Dock.” As a developer who builds new features for a living, I’m aware that developers love forcing their new code on users. But from a user’s standpoint, disruptive changes like this should be disabled by default.