Nifas refers to the legally recognized postnatal bleeding. Once it ends, ghusl is required because a specific state of ritual impurity has ended, not simply as a hygiene measure.
Menstruation and nifas share that general result but differ in detailed duration rules.