Cruise lines sometimes offer last minute cruise deals if cabins on a ship have not filled. They would rather sell a stateroom at a cheap price than let it go empty.
Not every cruise has these bargains. In fact they are increasingly rare. A few cruise lines (Royal Caribbean and Celebrity) have said they are discontinuing the practice.