The reason for the comparison is because he was being accused of breaking the law of the Sabbath given under Moses by "doing work" and healing a man. A common theme through out the Gospels is Jesus showing how the Israelites - and most especially the religious leaders - had twisted and peverted Gods laws into something that didn't actually reflect Gods will. The sabbath law is one he puts repeated focus on.
In this like other similar cases they say he has broken the law by doing "work" on the Sabbath. He points to the law of Circumcision to show that certain types of work are actually permitted on the Sabbath. Circumcision was considered to be a sacred ritual and so was permitted on the Sabbath and they themselves carry these works out and perform them on the Sabbath without breaking the law.
Now if a boy can be circumcised on the Sabbath so that the law of
Moses may not be broken, why are you angry with me for healing a man’s
whole body on the Sabbath?
He is essentially showing their own hypocrisy. Showing that they already allowed certain types of work on the Sabbath and he is showing the words they are judging him with - would actually condemn them too because they perform these works. Additionally I think hes trying to show that "good works" (eg: healing or helping someone) should also be considered "sacred" or "holy" work which is permitted on the Sabbath.
He draws a similar parallel after a incident in Matthew 12:5. In this case he uses the example of priest working in the temple on the Sabbath yet are innocent of breaking the Sabbath law.
Or haven’t you read in the Law that on the Sabbath the priests in the
temple break the Sabbath and yet are innocent?
And lastly the reason it mentions circumcision did not actually come from Moses it because it actually came from Abraham Gen 17:9-11 but its included in the Mosaic law.