How bright a star appears from Earth is a function of its intrinsic brightness, called its absolute magnitude, and its distance. Together, these factors make up the star's apparent magnitude, according to Universe Today. While the sun has a lower absolute magnitude than many stars, it is much closer.
The sun has an apparent magnitude, as seen from Earth, of minus 26.8, which makes it by far the brightest object visible in the sky. The sun's absolute magnitude, however, is a mere 4.75. The Pistol star, with an absolute magnitude of minus 14.2, is the brightest star visible from Earth in absolute terms.