When supplied with soil in the form of gravel or sand, the sluice scans the nearby area for ores and produces output when it finds any. The scan range is a 3x3 chunk zone centered on the sluice, and about 16 blocks deep. With a config option, they can also take dirt.
No ore blocks are consumed in the process, but the stored data structure representing the sum total of those blocks is slowly depleted, eventually exhausting a given area.
Container and non-container sluices should produce comparable results for the same amount of input material. Container sluices will drop the same materials input when broken, to the best of its ability (if a non-whole number it will randomly generate a drop or not based on the fractional value).