The function is callback, that the AMD loader will call when it has loaded all the modules that you require.
If I have
require(["dojo/_base/ready", "dojo/_base/declare"], function(ready, declare) {
// do something with declare and ready
});
AMD is going to load ready and declare. This may require AMD to make an asynchronous call back to the server. Once AMD has loaded the modules, it calls the function you passed into the require
method.
My answer at Dojo Builds...? What now? has some more details on the AMD API.
Answer to the question in the comment. The following two statements could be anywhere on the page.
<script type="text/javascript">
require(["dojo/_base/ready", "dojo/_base/declare"], function(ready, declare) {
// do something with declare and ready
});
</script>
<script type="text/javascript">
require(["dojo/_base/ready", "dojo/_base/declare", "dijit/form/Button"],
function(ready, declare, Button) {
// Assuming this is the second statement to be executed, AMD will
// realize that ready and declare have previously been loaded,
// so it will use the previously loaded modules, load the Button module,
// and then execute the callback
// do something with declare, ready, and Button
});
</script>