How loose rice becomes a solid cake
A grain of rice is mostly starch packed in hard granules. Boiled in water, the granules take up water and swell to several times their size, and some of the starch leaks out as a sticky gel. In an open pot the swollen grains have room and stay separate. In a ketupat they do not. The case is half full of raw rice; as the grains swell they fill it, then press against the leaf and against one another. With nowhere to go, they are squeezed together while still soft, the gaps between them fill with leaked starch, and the grains fuse. When the ketupat cools, the starch sets firm. The result can be sliced cleanly and no longer looks like grains at all.
Why half full
Rice roughly doubles or more in volume as it cooks. Fill the case too little and the rice never packs tight; too much and it cannot absorb enough water and stays hard in the middle.
Why so long
The rice is cooked in an hour. The further hours let water reach the centre of a dense mass and let the starch break down enough to fuse completely.
Why it must stay under water
Any part above the water cooks unevenly and stays hard. Cooks top up the pot with boiling water throughout.
What the leaf does
The woven leaf is a mould, a pressure vessel and a wrapper in one. It is strong enough to resist the swelling rice, and porous enough to let water in. It also gives something to the rice: a faint grassy, tea-like scent and a pale green-yellow tint on the outer surface, which is why ketupat boiled in leaf tastes different from pressed rice or the plastic-pouch kind. And because the cake is boiled for hours inside a closed wrapper and left unopened, it keeps for a day or two at room temperature, longer than cooked rice left in a bowl, which mattered a great deal before refrigerators and on the eve of a festival when everything had to be made ahead.
Why ordinary rice
Everyday white rice has enough of the firm-setting kind of starch to make a cake that slices. Glutinous rice, which has almost none, makes a soft sticky one: that is ketupat palas.
Why it firms in the fridge
Cooked starch slowly recrystallises as it cools, the same change that makes bread stale. Chilled ketupat is hard; warming reverses it.
Why it suits gravy
A dense cake absorbs sauce slowly from the outside in, so it carries gravy without falling apart.