What's the difference between (function($) { /* code */ })(jQuery); and $(document).ready(function(){ /* code */ }); ?

What's the difference between (function($) { /* code */ })(jQuery); and $(document).ready(function(){ /* code */ }); ?

(function($) { /* code*/ })(jQuery);
$(document).ready(function(){ /* code */ });

I know that document.read is loaded when html page is been loaded. But what's the difference between the two?

Thanks.