What is mainAsset in BuildAssetBundle?

In C# I am trying to use BuildPipeline.BuildAssetBundle, but I don't understand what the first parameters "Object mainAsset" is for. If its just a collection of assets why does it need a mainAsset? When should I use mainAsset instead of the next parameter which is an array of objects? Does it matter what I put for mainAsset if I never use it?

I cobbled together this code from the forums:

// Bring up save dialog. 
string path = EditorUtility.SaveFilePanel("Save AssetBundle", "", "New AssetBundle", "unity3d");
if (path.Length > 0) 
{
    // Get all selected objects.
    Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
    BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets); 
} 

It does produce an asset bundle - but I need to know how it works!

You don't need to provide a mainAsset. If you do, then that will be the asset available when you use the assetbundle, and you want to say myassetbundle.mainasset. If for instance you have an assetbundle with a character, its textures and its animations, you could put the prefab of that character as the mainasset.

you could also make an agreement with yourself that you just name the prefab "Character" always, and that you load it by name from the assetbundle instead.