By layers, you mean terrain texture layers?
The built-in Ogre terrain material has a
limit on the number of layers supported. This limit comes from the maximum number of texturing units you can use in a single render pass. Ogre currently hardcodes this limit as 16 texture units (some GPUs support more, but not all do).
If you do enable (PSSM) shadows, extra texturing units are required to sample the shadow maps, thus you don't get as many layers available. You also need texture units for normal maps.
There are ways around this limit, such as rendering the terrain in multiple passes. Which I've done in the past, as you can see
here. It's a bit complicated though.