Simple version: You make your model, then take a snapshot of the polygons of the surface you want to texture and draw over the top with an image editor.
Of course how you unwrap and texture is another matter. Some use a UV unwrap so you can make one image for the whole surface regardless of which direction the surface is facing, like peeling the skin off an animal, flattening it and painting it. It can be a confusing and difficult job, but it saves a lot of work. Others use other ways to break up the surface for texturing, but it all boils down to taking a snapshot of the polygons and drawing over the top.
You also can use images to do a lot more, like controlling how shiny, glossy, reflective, bumpy or brightly lit some parts are. A final texture may well consist of many layers of fractal generated maps and image maps layered and adjusted to get just the right look for the material. Oh, and each model program is usually slightly different in how it's done. Just know that most complex models usually take as long in photoshop as they do in the model program before you're finished.