Why did Moses free the slaves?

Moses freed the slaves because god beleved no one should be held prisoner nore slave.And once moses beleived in god he did wat he said he said