When re-parenting instantiated object as child of current gameObject, why does GetComponents() not retrieve instantiated object's components?

Say I have instantiated an object:

GameObject example = Instantiate();

I change the parent of said instance to the GameObject attached to this script:

example.transform.SetParent(transform);

I would expect that, since the instantiated object is in the hierarchy of the GameObject attached to this script, that the following code would not return an empty list:

var bodies = GetComponent();

However, it does. I know that the prefab in my code has a Rigidbody component. Since the instantiated object is in the new hierarchy, and the Rigidbody is a component of that instantiated object, why is it not returned by GetComponent ?

Thank you in advance for anyone’s advice.

Probably seems silly to answer my own question, but I found the problem. I did not realize that GetComponent() is not recursive: it only looks on the GameObject attached to this script to find a component of . What I really needed was GetComponentInChildren().