The 10 Commandments summarise the moral law God gave to his covenant people. This was to set them apart from the pagan nations around them, to show the world the difference between them and doing things God's way. God always deals with people in covenant relationships. Before the Mosaic covenant there was the Abrahamic covenant and the Noachian covenant.
But the Israelites could never keep God's perfect law which was intended to show them the need for sinners to receive forgiveness from God. It was designed to point them to the coming Messiah who would be, in himself, the once-for-all-time perfect sacrifice to take away the sin of the world. That's why Jesus kept the Law perfectly (he was a perfect man, without sin). No other religious teacher has ever come close to that. Because Jesus kept the Law perfectly, he fulfilled it and then replaced it with the New Covenant, in his blood. This is what Christians are under; it incorporates all the principles of the ten commandments.