Why do stars have spikes in NASA's James Webb telescope images?

Images of stars taken by NASA's James Webb Space Telescope appear with six spikes, while stars in Hubble photos appear with four.

 The first full-color image from NASA's James Webb Space Telescope, a revolutionary apparatus designed to peer through the cosmos to the dawn of the universe, shows the galaxy cluster SMACS 0723, known as Webb’s First Deep Field, in a composite made from images at different wavelengths.  (photo credit: NASA/HANDOUT VIA REUTERS)
The first full-color image from NASA's James Webb Space Telescope, a revolutionary apparatus designed to peer through the cosmos to the dawn of the universe, shows the galaxy cluster SMACS 0723, known as Webb’s First Deep Field, in a composite made from images at different wavelengths.
(photo credit: NASA/HANDOUT VIA REUTERS)

Since the first images of the James Webb Space Telescope were released to the public in July, NASA has been researching the new images it has been getting of stars and planets.

Since it was first launched last December, the telescope has taken detailed images of astronomic bodies such as Jupiter and the Pillars of Creation.

One thing that most of the images have in common is that they show six large spikes in many stars photographed by the telescope and two smaller spikes. This is different from the images taken by the older Hubble Space Telescope, which only shows up to four spikes in the stars in its images. The Giant Magellan telescope that is under development is expected to show no spikes at all on stars

What causes the spikes in stars in NASA space telescope pictures?

Since the stars clearly do not actually have spikes, why do they show up in images taken by telescopes and why are they different for each telescope?

 This illustration depicts NASA’s James Webb Space Telescope – the largest, most powerful, and most complex space science telescope ever built – fully unfolded in space. The telescope’s first full-color images and spectroscopic data will demonstrate Webb at its full power, ready to begin its mission (credit: NASA/Adriana Manrique Gutierrez) This illustration depicts NASA’s James Webb Space Telescope – the largest, most powerful, and most complex space science telescope ever built – fully unfolded in space. The telescope’s first full-color images and spectroscopic data will demonstrate Webb at its full power, ready to begin its mission (credit: NASA/Adriana Manrique Gutierrez)

According to an explanatory video published by NASA, the spikes are a result of the way the stars' light hits the mirrors that capture the images in the telescope. The James Webb telescope, for instance, has a hexagonal mirror made up of 18 pieces, and the gaps between the pieces create rough lines of light that appear as spikes.

The exact number of spikes is down to the struts in the telescope. the James Webb telescope has three struts that are used to unfold the secondary mirror. The light from the stars hits the secondary mirror and reflects off it, hitting the struts which block the light. Each strut causes two peaks that appear at a right angle, hence three struts create six spikes.

The Hubble telescope, on the other hand, shows four spikes because it has eight struts, meaning that the right-angle spikes overlap and make it look like four spikes.

The Giant Magellan telescope is under construction in Chile and is expected to have such powerful image-taking abilities that it will not represent spikes in the images it takes of stars. The secondary mirrors are designed to have the ability to fully clean up light distortions in their images.