Use this phrase when something has gone away, but you think that it will return:
We got rid of the ants in the kitchen, but I bet we haven't seen the last of them.
This means that you think that the ants will return one day.
This phrase sounds a bit dramatic, so it's often used in TV shows and movies. Imagine that the hero of a TV show has defeated the villain. The villain might say:
You win this time, but you haven't seen the last of me!