Why?

The answer

Earth's tilted axis makes each hemisphere lean toward the Sun for half the year, giving it higher sunlight and longer days.

Earth spins around an axis that is tilted about 23.4 degrees, and that axis keeps pointing the same way in space (toward the North Star) all year as Earth goes around the Sun.

So for part of the year the Northern Hemisphere leans toward the Sun, and six months later it leans away. The Southern Hemisphere is always the opposite, which is why their seasons are flipped.

Leaning toward the Sun does two things. The Sun climbs higher in the sky, so its light hits the ground more directly and each patch of ground gets more energy. And the days get longer, so there are more hours of heating and fewer hours of cooling at night.

Distance barely matters. Earth's orbit is nearly a circle: it is about 147 million km from the Sun in early January and about 152 million km in early July. That small change is not what makes summer and winter.

Go deeper

Why? Why does low sunlight heat less?

Shine a flashlight straight down and you get a small bright spot. Tilt it and the same light spreads over a bigger, dimmer patch. Low winter sunlight is spread out the same way, so each square metre of ground gets less.

Why? Why are the equator's seasons so mild?

Near the equator the noon Sun is always high and days are always close to 12 hours, so the tilt changes little. Many tropical places have wet and dry seasons instead of hot and cold ones.

Why? Why is the hottest weather weeks after the longest day?

Land and especially oceans take time to warm up. They keep soaking up more heat than they lose for weeks after the June solstice, so the warmest days usually come in July or August in the north.

Sources