How do I count how many instances of a prefab there are?

Really basic question, but just not obvious to me: how can I find out how many of something there are in the whole level?

It's a predator/prey/competitor population sort of situation, where all the prefab instances keep getting born and dying all the time, and what happens to any individual depends on how many of its own kind there are, as well as how many of one or more others.

So I also want to know what the best, simplest, most flexible way is to do this. Should it be a script on one global thingcounter/healthupdater object doing an InvokeRepeating every so often? Or is actually counting them something to be avoided altogether, and instead make a variable and just make sure it goes up by one every time a new one is born and down by one every time one dies?

I would use your second solution myself. A static variable the increments and decrements would be sufficient and efficient I think.

void Update ()
{

GameObject thingyToFind = GameObject.FindGameObjectsWithTag (“ThingyToFind”);

int thingyCount = thingyToFind.Length;

}

you can set tags and then use GameObject.FindGameObjectsWithTag()