A phoneme is an abstract entity deduced from the distribution of phones (actual sounds) in a language. It is typically transcribed with the symbol that represents the most common sound (allophone) of that phoneme, or rather the one that represents the "intersection" of the features the phoneme is considered to have in the present analysis. The second clause of the current Principles of the IPA reads:
The IPA is designed to be a set of symbols for representing all the possible sounds of the world's languages. The representation of these sounds uses a set of phonetic categories which describe how each sound is made. These categories define a number of natural classes of sounds that operate in phonological rules and historical sound changes. The symbols of the IPA are shorthand ways of indicating certain intersections of these categories. Thus [p] is a shorthand way of designating the intersection of the categories voiceless, bilabial, and plosive; [m] is the intersection of the categories voiced, bilabial, and nasal; and so on. The sounds that are represented by the symbols are primarily those that serve to distinguish one word from another in a language.
So each letter of the IPA represents not a rigidly defined set of articulatory configurations (because there are theoretically infinite shades of sounds between each category) but an abstract class of sounds, which may then be applied to represent an actual sound, or at least a narrower set of sounds, for more physically oriented purposes.
In English, [p] and [pʰ] are co-allophones of the phoneme /p/ (that is, no pair of words are found to be different just in [p] vs. [pʰ]). The letter 〈p〉 is chosen for the phonemic representation because aspiration or lack thereof is not distinctive in English, and therefore the categories "voiceless", "bilabial" and "plosive" are considered enough to identify these sounds, which make up a category of mutually non-distinctive sounds, i.e. a phoneme. And since writing e.g. "voiceless bilabial plosive + high front lax vowel + alveolar nasal" to phonemically represent the word pin each time takes considerable time and space, we write /pɪn/ as a shorthand for that.