Why is the set $K$ recursively enumerable? I am trying to understand why the set $K=\{i \mid M_i(i) \;\mathsf{halts}\}$ is recursively enumerable, where $M_i(i)$ is a Turing machine that is given its own index (in the standard enumeration of Turing machines) as input ("the halting problem").
If we cannot determine if $M_i(i)$ halts, how could we even produce the set $K$ in the first place? If $K$ were recursively enumerable, we could have a Turing machine $M_K$ that takes this set as input and outputs a list of all of its elements. But if this were the case, the halting problem would be solvable because of the fact that all of the elements of $K$ are known in the first place.
I am obviously missing a big point here. What am I missing?

Just because you have a machine that outputs the elements of $K$ doesn't mean they "are all known".
The problem is that $M_K$ does not necessarily output the elements in order, so just observing the run of that machine will never allow you to conclude that some number is not in $K$. You can fun the machine for a year and notice that your favorite number has not yet been output, but you can't know whether it will be output next week, or in another year, or a century -- or, indeed, never at all.
This is THE difference between "decidable" and "recursively enumerable".
