Lightning is always accompanied by thunder. Lightning is a huge electrical discharge. Static charges form in a storm composed of ice crystals and liquid water drops. Turbulent winds inside the storm cause particles to rub against one another, causing electrons to be stripped off, making the particles either negatively or positively charged.
The charges get grouped in the cloud, often negatively charged near the bottom of the cloud and positively charged up high. This is an electric field, and because air is a good insulator the electrical fields become incredibly strong. Eventually a lightning bolt happens to neutralize the electric field.
The lightning bolt rapidly heats the air around it, to as hot as 50,000 degrees. This rapid warming causes the air to quickly expand and generate a sound wave.
That sound wave is thunder. Sound can interact with objects in multiple ways. Snowfall, and snow on the ground, tends to muffle the sound.
Thunder is common in the summer when cumulonimbus clouds have strong updrafts of warm, moist air that can rise upward to 40,000 feet or more. The air is above freezing near the ground and far below freezing near the top of the updrafts. This provides for lots of opportunity to generate an electric field.
Thunder is not common in winter as the storms are shallower than the summer convection. Most of the precipitation in winter occurs below about 20,000 feet and the turbulent motions are weaker. The colder temperatures also make for few liquid water drops in the winter storms.