How is a Button component able to access a method on a prefab?

I’m just getting started with Unity and I have some questions around the nuances of the Button component.

I find that a Button component can call methods against a prefab if you drag that prefab into it’s OnClick list. How is it able to do this without the object being instantiated in the scene?

It’s just a general question that I feel would help me better understand what’s going on under the hood.

Thanks in advance!

Hi!, I hope this is not being too late. I don’t know if it will help you, you can drag your button code to your whole Prefab Gameobject, if that is a button, you can drag the button action from your own prefab gameobject with your respective code inside them. That’s the way you can use a method in a prefab component. In that order it will be a Prefab programmed component.