The eved Ivri - a Jew who was indentured to pay off a debt - was not to be dismissed with a casual "see ya!" He worked for his master for six years, during which time he was virtually a member of the family. It's only appropriate to give him a proper send-off. The master is to give the servant gifts so that he can make a fresh start in the world. This obligation is actually the topic of the next mitzvah; here, we have a prohibition against sending the servant away empty-handed.
The reason for this mitzvah is that it is proper for us to be generous and to have gratitude for those who have labored on our behalf. It would be completely ungracious to send the eved Ivri without showing our appreciation by helping him start the next chapter in his life.
This mitzvah only applies in Temple times. It is discussed in the Talmud in the first chapter of tractate Kiddushin (pages 14b-17b) and codified in the Mishneh Torah in the third chapter of Hilchos Avadim. This mitzvah is #233 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.