GDScript uses reference counting to manage memory. Under the hood the scripting engine keeps track of how many references currently exist for every object. When number of references reaches zero, the object is automatically deleted.
However, only built-in container types and objects that derive from Reference class are counted in this way. Custom objects that don't have Reference class in their upstream inheritance chain are not reference counted. They need to be explicitly deleted using free(). This includes all node types. Check class' inheritance chain in the docs to determine if its instances are reference counted or not.
So if you have an array of ref counted objects, and they are only referred to from that array, assigning null to the array variable will delete everything. Letting the array variable go out of scope will do the same.
Conversely, if you have an array of nodes you'll need to iterate and free() each node manually.