Biryani is often described as a rice dish with meat in it, which misses the technique entirely. It is two preparations brought together at a precise point and finished in a sealed vessel.
Two components, cooked apart
The rice is parboiled in heavily salted, aromatic water and drained while still firm, deliberately short of done. The meat is cooked separately in a thick, well-reduced gravy.
Neither is finished at the point of layering, and both are intended to complete during the last stage rather than before it.
Cooking either component fully first guarantees a poor result, since the final stage adds time that has to be accounted for somewhere.
What the sealed pot actually does
Layering the two and sealing the lid with dough traps the steam released by the gravy. That steam rises through the rice and finishes cooking it from below.
Because the moisture is recycled rather than escaping, the rice cooks in aromatic vapour rather than in liquid, and the grains stay separate instead of swelling into each other.
The seal also holds volatile aromatics inside, which is why the smell released on opening is treated as part of the dish.
Why the rice must stay dry
Draining the parboiled rice thoroughly matters because any surface water adds to what the steam is already supplying, and the excess turns the lower layers into a paste.
Long-grain aged rice is preferred for a related reason, since it absorbs more water without collapsing and its grains remain distinct at higher hydration.
Washing the rice before cooking removes loose surface starch, which would otherwise make the grains stick to one another as they finish.
Heat has to come from below and above
The traditional method places coals on the lid as well as heat beneath the pot, so the upper layers receive heat directly rather than only from rising steam.
Without that, the top of the pot stays cooler and the rice there finishes underdone while the base has already gone too far.
Domestic versions approximate it with a very low flame and a heat diffuser, trading speed for evenness since the pot needs time to equalise.
Why the two main styles diverge
One approach layers raw marinated meat under parboiled rice and cooks both together, which demands exact judgement of quantities and timings but yields the most integrated result.
The other cooks the meat fully first and uses the sealed stage only to finish the rice, which is far more forgiving and is what most restaurants use.
The finished dishes differ noticeably in how far the gravy has penetrated the grain, and that difference, rather than the spice mix, is what separates the styles.