yield from flattens, and loses the keys you expected

yield from preserves the inner generator’s keys, which means two delegated generators both starting at zero produce duplicate keys.

function a() { yield 1; yield 2; }
function b() { yield 3; yield 4; }

function both() { yield from a(); yield from b(); }

iterator_to_array(both());        // [3, 4] — keys collided
iterator_to_array(both(), false); // [1, 2, 3, 4]

// foreach sees all four either way. only the array
// conversion loses them.

The keys are preserved because yield from is delegation rather than concatenation, and each inner generator numbers from zero. Everything works until somebody calls iterator_to_array, which silently overwrites — and the loss is silent, with no warning and a shorter array. Passing false as the second argument discards the keys and is almost always what was meant.