Barfi is cut into diamonds and picked up with fingers. Halwa is served with a spoon and never holds an edge. The ingredients overlap heavily, so the difference lies in what is doing the setting.

Barfi sets on crystallized sugar

A barfi mixture is cooked until enough water has left that the sugar can no longer stay dissolved. As it cools, that sugar comes out of solution as fine crystals locked around the fat and solids.

The crystal network is rigid. It is what lets a slab be scored while still warm and separated into clean, square-edged pieces once it has gone cold.

Cook the mixture too little and the sugar stays dissolved, leaving a sticky mass that never firms. Cook it too far and the crystals grow coarse and the piece turns brittle and dry.

Halwa sets on starch that never gives up its water

A halwa is built on a starch, whether semolina, flour, or a starchy vegetable. The starch granules swell with liquid and hold that liquid inside them.

Hydrated starch does not crystallize as it cools. It stays soft and yielding, which is precisely why a halwa is scooped from a dish rather than cut into pieces.

The fat in a halwa coats those swollen granules and keeps them separate, producing the glossy, slack texture the dish is actually judged on.

The clue is in the order of operations

Barfi recipes add sugar early and cook the whole mixture down together, because water has to leave the pan before the sugar is able to crystallize properly.

Halwa recipes toast the starch in fat first, then add liquid and sugar. Toasting limits how far the starch can swell, which is how a cook controls whether the result is loose or dense.

Substitutions fail in predictable directions

Adding extra milk solids to a halwa makes it richer but not firmer, because nothing in that addition creates the crystal network that firmness depends on.

Adding starch to a barfi mixture keeps it soft, since hydrated starch holds the water the sugar needs to release in order to crystallize. Recipes doing both usually produce a sweet that is deliberately neither.

Storage behaves differently for the same reason

Barfi dries as it ages, because the crystal structure keeps tightening while moisture escapes from the cut surfaces. It goes hard well before anything else happens to it.

Halwa holds its moisture longer but reheats poorly once the fat separates from the starch. It is made in the amount that will be eaten rather than stored for later.