Typically, the way those sensors work is that one of them emits IR, and the other detects IR and changes resistance by how much IR it detects.
The draw-back of those is that, typically, the range is measured in millimeters, not meters like with the higher-end Sharp IR sensors.
Note that the Sharp ones are range finders. The $50 robot is supposed to be a "photovore" -- sense how much light there is, not how far away something is.