On etherscan.io there is a contract`s source code tab, where does Etherscan get this code? If developers make it available for Etherscan then is it necessary for them to public it or specifically make it available on Etherscan?

For example this code of cryptokittes can be found on Etherscan along with several other dapps.