What is the meaning of [rats desert a sinking ship]

People tend to leave an organization, pull out of a project, or abandon a cause when they become aware that it is heading for disaster;often used to imply disloyalty, or to predict the imminent failure of something