The main loop is iterating from 0 to (2^set_size)-1. For example if there are three elements in the set it will iterate from 0 to 7 ((2^3)-1). If you represent it in binary it will be: 000, 001, 010, 011, 100, 101, 110, 111.
These are all subsets of a three-element set (1 - we take the element, 0 - we don't take it). Now you only need to iterate and check if we take j-th element (if the j-th bit is equal to 1). The easiest way to do it is to check if (i & (2^j)) is equal to a non-zero value (& is a bitwise operation that for every position in the numbers returns 1 if in both numbers have on this position a lit bit and 0 in any other case). The if operation treats 0 as false and positive values as true, so if the j-th bit is lit the operation will return 2^j and it will be a true value, so this element will be taken to this subset, otherwise if the bit isn't lit the operation will return 0, so this element isn't in this subset .