The cycle of day and night can be explained by two phenomena:
Because the Earth is round and light travels in a straight line, the Sun cannot illuminate the entire surface of the Earth at the same time. When one side of the Earth is illuminated and it is daytime, the other side receives no solar radiation and it is nighttime.
So while one half of the Earth is exposed to the Sun, the other half is in darkness. It is thanks to the Earth's rotation that all of its surface can, at some point, receive light from the Sun.
The rotation of a celestial body refers to the fact that it turns on itself. The Earth rotates in approximately 24 hours from West to East.

The origin of the Earth's rotation can be traced back to its formation. The particles of matter orbiting the young star gravitated towards each other to form the centre of the new planet.
As the particles get closer to the centre, they accelerate and come into contact with the centre, which gets bigger over time. The addition of all these collisions created, in the long term, a rotational motion in the celestial body, which today has given rise to the Earth's rotation.
The Earth rotates on itself while being tilted in relation to the Sun. The Earth's rotational axis is tilted at an angle of 23.4° to the vertical. As a result, the length of days and nights is unequal. This is caused by the Earth's revolution around the Sun, its rotational motion and its tilt.
In the image below, the Sun's rays are hitting the left side of the Earth. The southern hemisphere is therefore tilted towards the Sun: it is summer in this component of the globe. The South Pole stays in the light for a long time because it is tilted towards the Sun. There is therefore more light than umbra, i.e. the day is longer than the night. At the same time, in the northern hemisphere, it's winter. The North Pole is in darkness because it is tilted away from the Sun. There is less light than umbra, meaning that the day is shorter than the night.
The situation reproduces itself when the Earth's tilt is the opposite, i.e. when the Earth is tilted so that the northern Hemisphere is tilted towards the Sun. In such a position, the northern Hemisphere remains facing the Sun for longer: there is therefore more light than umbra, which means that the day is longer than the night. At the same time, in the southern hemisphere, there is more darkness because this hemisphere is tilted away from the Sun. There is therefore less light than umbra, meaning that the day is shorter than the night.
At the autumn and spring equinoxes, half the Earth faces the Sun. The northern and southern hemispheres receive as much light as umbra: day and night are therefore of equal length.
The closer you are to the equator, the less the effect of the length of the day varies. In these regions, the length of day and night is almost always the same, at around 12 hours.
At the North Pole, it never gets light at the start of winter, because the Sun stops illuminating the regions inside the Arctic Circle. This is the polar night.
What's more, during the summer solstice in this same region, it never gets dark: the Sun is visible 24 hours a day. This day is known as the midnight sun.
Just like the seasons, the polar night and the midnight sun are reversed for the Antarctic Circle.