How does a texture image file get mapped on an OBJ model?
The reason is because the capsule object already has a UV Map, as shown in the image below.
The OBJ file format keeps the UV coordinates, which are assigned during unwrapping of your model in the UV space.



The answer to "How do we know where the first pixel on the top left corner of the texture file will stay on the OBJ model surface?" is unwrapping. Basically, when you unwrap your model, you unfold it so you can have a 2D projection of it. A simple object like the capsule is fairly simple to unwrap to a single part. But if you have a more complex object (such as Suzanne), you have to separate your mesh in several parts by creating Seams, and unfold one part at a time, to get a result like this:



This procedure is fundamental to apply textures on your model: any other texture will be applied based on the UV map coordinates that you have created. My suggestion is to use a checker color grid while you unwrap your model, so you can have a nice preview of how the textures will be applied on your model:





Keep in mind this concept: any other texture will be applied in the same exact way the color grid is applied. You have to take control of the distortions: it's normal to have some distortion while unwrapping your model (because you convert your model from 3D to 2D). Adding seams reduce a lot the distortions on your unwrap. Anyway, common mistakes at the beginning are:


stretched and/or squashed uvs (first image below)
not uniform scale of the projections (second image below)





The model is correctly unwrapped when you see perfect squared numbers of the color grid texture over all the parts of your model.

Useful resources:


Darrin Lile - Basics of UV Map 
Darrin Lile - Character UV Map