The Earth's revolution around the Sun, combined with the tilt of its axis, causes different parts of the planet to receive varying amounts of sunlight at different times of the day and year. As the Earth orbits the Sun, different regions are tilted either toward or away from the Sun, resulting in changes in the angle at which sunlight strikes the Earth's surface.
During the day, the side of the Earth facing the Sun is illuminated and receives more direct sunlight, resulting in brighter conditions. As the Earth rotates on its axis, different regions move from the side facing the Sun to the side facing away, transitioning from day to night.
In summary, while the rotation of the Earth contributes to the alternation of day and night by determining the length of a day, the primary cause of the varying solar energy responsible for these phenomena is the Earth's revolution around the Sun and the resulting changes in the angle at which sunlight strikes different parts of the Earth.