Because the moon isn't close, and the sun is even farther and much, much bigger than you're even attempting to comprehend. That's how.
The moon is 238,900 miles away (on average) from the earth, and is 2,159 miles in diameter and the sun is 92,960,000 miles away (on average), and 864,576 miles...