Why is Prefab declared as type Transform?

I am looking through some code for a simple game where eggs are dropped into a basket.
The script that spawns the eggs uses a prefab and thus creates them with the Instantiate method. However, what confuses me is what is passed into the first parameter of the Instantiate method.

    public Transform eggPrefab;
    Instantiate(eggPrefab, spawnPos, quat);

Why is the eggPrefab declared as a type Transform when it is in fact a GameObject? Isn’t a Transform object just something that can be contained inside of the eggPrefab?

Thanks,

Transform is not just a representation of position, scale and rotation in the scene, but also a Component subclass that is attached to your prefab game object. The documentation for Instantiate describes:

If you are cloning a Component then the GameObject it is attached to will also be cloned, again with an optional position and rotation.

Thus your prefab is referenced in the script by its Transform component alone. Calling Instantiate with this reference will clone the Transform AND the prefab game object.

From the Unity Documentation:

This function preserves the position and rotation of the cloned object. This is essentially the same as using duplicate command (cmd-d) in Unity. If the object is a Component or a GameObject then entire game object including all components will be cloned. If the game object has a transform all children are cloned as well. All game objects are activated after cloning them.

You can find the full article with more information
here.

Essentially, it can be either or. Holding onto the transform can shortcut the need to grab it manually if you need position information and you can clone it as its a component on the game object, which as the above states, will clone the entire game object.