The red color in apples is primarily due to the presence of pigments called anthocyanins. These natural compounds are responsible for the vibrant red, purple, and blue colors in many fruits and vegetables. In apples, these pigments accumulate in the skin as the fruit ripens, especially when exposed to sunlight.