The method of sensing touch can vary according to the manufacturer and the technology they adopt, the main ones being Infrared (most widely used), Optical (camera based), Resistive and capacitive.
Without going into too much detail they work as follows:
Infrared - An infrared touchscreen uses an array of X-Y infrared LED and photodetector pairs around the edges of the screen to detect a disruption in the pattern of LED beams. These LED beams cross each other in vertical and horizontal patterns. This helps the sensors pick up the exact location of the touch. A major benefit of such a system is that it can detect essentially any input including a finger, gloved finger, stylus or pen.
Optical - Optical touch screen displays operate where two or more image sensors are placed around the edges (mostly the corners) of the screen. Infrared back lights are placed in the camera's field of view on the other side of the screen. A touch shows up as a shadow and each pair of cameras can then be pinpointed to locate the touch or even measure the size of the touching object. This technology has some limitations in that it may sense a touch where the beam is crossed without the user necessarily touching the surface so could register a user hovering over an area.
Resistive - A resistive touchscreen panel comprises of several layers, the most important of which are two thin, transparent electrically-resistive layers separated by a thin space. These layers face each other with a thin gap between. The top screen (the screen that is touched) has a coating on the underside surface of the screen. Just beneath it is a similar resistive layer on top of its substrate. One layer has conductive connections along its sides, the other along top and bottom. A voltage is applied to one layer, and sensed by the other. When an object, such as a fingertip or stylus tip, presses down onto the outer surface, the two layers touch to become connected at that point: The panel then behaves as a pair of voltage dividers, one axis at a time. By rapidly switching between each layer, the position of a pressure on the screen can be read.
Capacitive - A capacitive touchscreen panel consists of an insulator such as glass, coated with a transparent conductor As the human body is also an electrical conductor, touching the surface of the screen results in a distortion of the screen's electrostatic field, measurable as a change in capacitance. Different technologies may be used to determine the location of the touch. The location is then sent to the controller for processing. Unlike a resistive touchscreen, one cannot use a capacitive touchscreen through most types of electrically insulating material, such as gloves.