Like a lot of lizards, leopard geckos can drop their tails. They do this to distract the predator that might be trying to eat them. Their tails keep moving for a short duration of time after it detaches. It is a defensive mechanism that distracts the predator long enough so they can run into a hide.