The books and magazine articles devoted to guitar tone could fill a control room, but little has been written about the basic art of tuning. While you probably consult an electric tuner before tracking, that may not be enough to deliver perfectly in-tune tracks.
Some frets can play flat, others play perfectly in tune, and still others play sharp.
Tuning perfection may not be possible, but your job as a guitarist is to maximize your tuning and get your tracks as in tune as possible. Compromise vs. Perfection Equal tempered tuning, as used by pianos and other keyboard instruments, is the generally accepted standard of intonation. But equal-tempered does not mean precise intonation. Otherwise, certain intervals would work in some keys but would sound hopelessly dissonant in others. But the frets, while guiding the player to the correct pitch, also cause and exacerbate pitch inaccuracies at various places on the neck.