list manipulation – Get Prime numbers from 2 to 30


Why does this get Range[2,30]?

DeleteCases[Range[2,30], Alternatives @@
   Table[{b}, {a, 2, 30}, {b, 2 a, 30, a}] // Flatten[#, 1] &]

However, this below can get the Prime.

list2 = Table[b, {a, 2, 30}, {b, 2 a, 30, a}] // Flatten[#, 1] &;
DeleteCases[Range[2, 30], Alternatives @@ list2]

Isn’t these 2 the same thing?