How do touchscreens detect your finger's position?
Most modern touchscreens use capacitive sensing. Your finger conducts electricity, and when it touches the screen, it disturbs a small electrical charge across a grid of transparent conductors embedded in the glass. The screen measures where this disturbance occurs by detecting changes in capacitance at different points along the grid, allowing it to calculate your finger's exact position.
Older or simpler touchscreens use resistive technology instead, where two flexible conductive layers are pressed together by your finger, completing a circuit at that specific point. Some specialized screens use infrared beams or acoustic waves. Capacitive screens are now dominant in smartphones and tablets because they are more accurate, support multi-touch input, and respond to lighter touches.