You need to understand the basic of a digital image.
Image is recorded as pixels and image is a rectangle so many pixels wide and so many pixel high. Pixels do not have a fixed size. The images resolution setting defines the image current pixel size.
So for example if you have and image that is 300 pixel wide and 200 pixels high and set its dip resolution to 100DPI the image size is 3" wide and 2" high. Set its dip setting tp 300DPI the image size becomes 1" wide by 2/3" high. Both the 3" x 2" and the 1"x2/3" images have the same 60000 RGB Colored Pixels.
Web pages are sized to to be so many pixel wide and so many pixel high. Often the height is not enforced scrolling is used when viewing.
However image for web pages often must not exceed so many pixel wide and high for displays have a fixed resolution and a fixed number of Pixels. You want images to fit on users displays. Users use different displays some have high resolution displays and other have low resolution displays with far fewer pixels then high resolution displays.
Web Image are normally image that have been interpolated down in number of pixels a resampled large image so that web image will fit on a low resolution display with limited number of pixels. The image size the user see depend on the display they are currently using. A low resolution display's image will be much larger then the same image displayed on a nexus 10 with a 300dip display. Cheep low cost Desktop LCD have a 84DIP resolution, large high cost desktop displays are not be much higher in resolution somewhere near 108DPI. Tablets, Laptop and Phones can have much higher resolution like the nexus 10 300DPI IPS display