You are giving back the Bracha he gave you.
A story to answer your question also why it has to do with Parshas Mattos:
The answer is a story that happened to the Yeshouas Yackov at the age of twelve. A person came looking for a suitor for his daughter. At that point the Yeshouas Yackov was an established genius and a man came to test him. He walked in and said Shalom Aleichem and the boy answered Aleichem Shalom. The girl’s fathers looking to test his genius said why don’t you tell me something about Shalom Aleichem so this is what he replied. He asked our question why don’t the person who greets, and the person who responds say the same thing? He answered based on what it says in the Gemara in Nedarim when you make a Neder(vow) you say נדר לה-“A vow to Hashem” and not לה' נדר-“To Hashem a vow” because he may die in middle of speaking and say G-d’s name in vain. This leads us to another question how are we allowed to say Shalom Aleichem at all? As we know the Gemara in Shabbos says Shalom is Hashem’s name? The Yeshouas Yackov answered. It says in Masechtah Brachos that one who is first to greet his friend his days and his years are extended.Hence says the Yeshouas Yackov the First person can say Shalom Aleichem with no worries as he is promised a long life and will not die mid sentence but the responder must first say Aleichem and only then Shalom for the concern of this Gemara.