How does the Unity Editor actually add variables to public/protected fields when you drag objects onto the field?

So in my case I’m using the Oculus SDK. Whenever you want to grab an object with the Oculus SDK you have to add this “OVRGrabbable” script, a rigidbody, and a collider to the object. Then you have to drag the object’s collider into this protected “Grab Points” field in the OVRGrabbable script, which is just a protected array of colliders that is exposed to the designer in the editor with [SerializeField].

My issue is that I can add my colliders in the editor because it is a private serialized field, but I can’t do it in script.

My question is, what command is the Unity Editor actually running when you drag an object onto a public or serialized field? GetComponent<>() or GetComponents<>()? Or is it something else? How can I mimic this behaviour in script for private serialized fields?

why not just add create setters?

private int ovrVar;
public int OvrVar{ get { return ovrVar; } set { ovrVar = value } }