What, exactly, in a shader, stops batching from happening?

I've seen here that batching doesn't always happen. However, I don't think it is tied to alpha blending, as given by evidence here. Is it simply a matter of not using the Geometry queue, or what?

Edit: It's not that, according to the numbers on-screen. I'm clueless, and I haven't witnessed the problem yet myself, but I certainly want to take precautions to avoid it.

Lights seem to ruin batching, even if the gameobjects use a material that doesn't use lighting. One light is ok, but if you have two or more the amount of batching is reduced fast. Luckily lights that are completely out of range don't matter. To have some useless stats:

Test scene with floor plane and 35 equal prefabs, (about half of them visible):

  • No lights: 2 draw calls, 18 batched
  • 1 light: 3 draw calls, 18 batched
  • 2 lights: 12 draw calls, 11 batched (numbers depend on light positions)
  • 3 lights: 15 draw calls, 6 batched.

I explained some of the batching details in my iPhone Optimization talk at Unite 2009.

You can watch video here: http://unity3d.com/support/resources/unite-presentations/optimizing-for-unity-iphone-1.5