When a player's contract runs out or when they are sacked they become a free agent. You just pay their wages and not their value

You'll see (F) next to price which indicates a free agent